File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
src/Symfony/Component/Form
Tests/Extension/Core/Type Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
55
55
'second_name ' => 'second ' ,
56
56
'error_bubbling ' => false ,
57
57
));
58
+
59
+ $ resolver ->setAllowedTypes (array (
60
+ 'options ' => 'array ' ,
61
+ 'first_options ' => 'array ' ,
62
+ 'second_options ' => 'array ' ,
63
+ ));
58
64
}
59
65
60
66
/**
Original file line number Diff line number Diff line change @@ -72,6 +72,39 @@ public function testSetRequired()
72
72
$ this ->assertFalse ($ form ['second ' ]->isRequired ());
73
73
}
74
74
75
+ /**
76
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
77
+ */
78
+ public function testSetInvalidOptions ()
79
+ {
80
+ $ this ->factory ->create ('repeated ' , null , array (
81
+ 'type ' => 'text ' ,
82
+ 'options ' => 'bad value ' ,
83
+ ));
84
+ }
85
+
86
+ /**
87
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
88
+ */
89
+ public function testSetInvalidFirstOptions ()
90
+ {
91
+ $ this ->factory ->create ('repeated ' , null , array (
92
+ 'type ' => 'text ' ,
93
+ 'first_options ' => 'bad value ' ,
94
+ ));
95
+ }
96
+
97
+ /**
98
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
99
+ */
100
+ public function testSetInvalidSecondOptions ()
101
+ {
102
+ $ this ->factory ->create ('repeated ' , null , array (
103
+ 'type ' => 'text ' ,
104
+ 'second_options ' => 'bad value ' ,
105
+ ));
106
+ }
107
+
75
108
public function testSetErrorBubblingToTrue ()
76
109
{
77
110
$ form = $ this ->factory ->create ('repeated ' , null , array (
You can’t perform that action at this time.
0 commit comments