-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathphp_object_validation.yaml
61 lines (61 loc) · 3.22 KB
/
php_object_validation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
questions:
-
uuid: 1eebf878-8b97-60d4-9e76-99d84c92580c
question: "In which cases the following call will return true? $resolver->isDefined('username');"
answers:
- { value: "$resolver->setDefined(['username']);", correct: true }
- { value: "$resolver->setDefined('username');", correct: true }
- { value: "$resolver->setDefault('username', null);", correct: false }
- { value: "$resolver->setRequired('username');", correct: false }
help: 'https://symfony.com/doc/current/components/options_resolver.html#options-without-default-values'
-
uuid: 1eebf878-8b99-6de8-ac51-99d84c92580c
question: 'How can you set true as default value for a Node Type ?'
answers:
- { value: '->isTrue();', correct: false }
- { value: '->default(true);', correct: false }
- { value: '->defaultValue(true);', correct: true }
- { value: '->defaultTrue();', correct: true }
- { value: '->setDefault(true);', correct: false }
help: 'https://symfony.com/doc/current/components/config/definition.html#default-and-required-values'
-
uuid: 1eebf878-8b9b-60d0-8fee-99d84c92580c
question: 'Which of the following are valid types to use in setAllowedTypes method of Symfony\Component\OptionsResolver\OptionsResolver to validate a float value?'
answers:
- { value: double, correct: true }
- { value: 'OptionsResolver::DOUBLE', correct: false }
- { value: float, correct: true }
- { value: 'OptionsResolver::FLOAT', correct: false }
help: 'https://symfony.com/doc/current/components/options_resolver.html#type-validation'
-
uuid: 1eebf878-8ba1-6890-90cf-99d84c92580c
question: 'Which of these sentences is true ?'
answers:
- { value: 'Annotations mapping are enabled by default', correct: false }
- { value: 'UniqueEntity is provided by Doctrine Bundle', correct: false }
- { value: 'We can validate partial object with @Assert\GroupSequence', correct: true }
- { value: 'All assertions above are valid', correct: false }
help: 'https://symfony.com/doc/current/reference/constraints/UniqueEntity.html'
-
uuid: 1eebf878-8ba4-609a-b99c-99d84c92580c
question: 'Is it possible to define default values that depend on another option?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/components/options_resolver.html#default-values-that-depend-on-another-option'
-
uuid: 1eec0499-a76d-66d2-aadb-f1225a91311b
question: "Is this way of validating an email is valid ?$errors = $validator->validate('[email protected]', new Assert\\Email());if ($errors->count())"
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/validation/raw_values.html'
-
uuid: 1eec049e-b567-6be8-b3c9-3b80b710b68d
question: 'Which Assert check an array of data ?'
answers:
- { value: 'new Assert\Collection', correct: true }
- { value: 'new Assert\ArrayCollection', correct: false }
- { value: 'new Assert\Traversable', correct: false }
- { value: 'new Assert\Iterable', correct: false }
help: 'https://symfony.com/doc/current/validation/raw_values.html'