@@ -102,7 +102,9 @@ public function testCreateNamed()
102
102
103
103
public function testCreateBuilderForPropertyWithoutTypeGuesser ()
104
104
{
105
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
105
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
106
+ 'empty_data ' => null ,
107
+ ]);
106
108
107
109
$ this ->assertSame ('firstName ' , $ builder ->getName ());
108
110
}
@@ -112,7 +114,9 @@ public function testCreateBuilderForPropertyCreatesFormWithHighestConfidence()
112
114
$ this ->guesser1 ->configureTypeGuess (TextType::class, ['attr ' => ['maxlength ' => 10 ]], Guess::MEDIUM_CONFIDENCE );
113
115
$ this ->guesser2 ->configureTypeGuess (PasswordType::class, ['attr ' => ['maxlength ' => 7 ]], Guess::HIGH_CONFIDENCE );
114
116
115
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
117
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
118
+ 'empty_data ' => null ,
119
+ ]);
116
120
117
121
$ this ->assertSame ('firstName ' , $ builder ->getName ());
118
122
$ this ->assertSame (['maxlength ' => 7 ], $ builder ->getOption ('attr ' ));
@@ -121,7 +125,9 @@ public function testCreateBuilderForPropertyCreatesFormWithHighestConfidence()
121
125
122
126
public function testCreateBuilderCreatesTextFormIfNoGuess ()
123
127
{
124
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
128
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
129
+ 'empty_data ' => null ,
130
+ ]);
125
131
126
132
$ this ->assertSame ('firstName ' , $ builder ->getName ());
127
133
$ this ->assertInstanceOf (TextType::class, $ builder ->getType ()->getInnerType ());
@@ -131,7 +137,10 @@ public function testOptionsCanBeOverridden()
131
137
{
132
138
$ this ->guesser1 ->configureTypeGuess (TextType::class, ['attr ' => ['class ' => 'foo ' , 'maxlength ' => 10 ]], Guess::MEDIUM_CONFIDENCE );
133
139
134
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , ['attr ' => ['maxlength ' => 11 ]]);
140
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
141
+ 'empty_data ' => null ,
142
+ 'attr ' => ['maxlength ' => 11 ],
143
+ ]);
135
144
136
145
$ this ->assertSame ('firstName ' , $ builder ->getName ());
137
146
$ this ->assertSame (['class ' => 'foo ' , 'maxlength ' => 11 ], $ builder ->getOption ('attr ' ));
@@ -143,7 +152,9 @@ public function testCreateBuilderUsesMaxLengthIfFound()
143
152
$ this ->guesser1 ->configureMaxLengthGuess (15 , Guess::MEDIUM_CONFIDENCE );
144
153
$ this ->guesser2 ->configureMaxLengthGuess (20 , Guess::HIGH_CONFIDENCE );
145
154
146
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
155
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
156
+ 'empty_data ' => null ,
157
+ ]);
147
158
148
159
$ this ->assertSame ('firstName ' , $ builder ->getName ());
149
160
$ this ->assertSame (['maxlength ' => 20 ], $ builder ->getOption ('attr ' ));
@@ -155,7 +166,10 @@ public function testCreateBuilderUsesMaxLengthAndPattern()
155
166
$ this ->guesser1 ->configureMaxLengthGuess (20 , Guess::HIGH_CONFIDENCE );
156
167
$ this ->guesser2 ->configurePatternGuess ('.{5,} ' , Guess::HIGH_CONFIDENCE );
157
168
158
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , ['attr ' => ['class ' => 'tinymce ' ]]);
169
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
170
+ 'empty_data ' => null ,
171
+ 'attr ' => ['class ' => 'tinymce ' ]
172
+ ]);
159
173
160
174
$ this ->assertSame ('firstName ' , $ builder ->getName ());
161
175
$ this ->assertSame (['maxlength ' => 20 , 'pattern ' => '.{5,} ' , 'class ' => 'tinymce ' ], $ builder ->getOption ('attr ' ));
@@ -167,7 +181,9 @@ public function testCreateBuilderUsesRequiredSettingWithHighestConfidence()
167
181
$ this ->guesser1 ->configureRequiredGuess (true , Guess::MEDIUM_CONFIDENCE );
168
182
$ this ->guesser2 ->configureRequiredGuess (false , Guess::HIGH_CONFIDENCE );
169
183
170
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
184
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
185
+ 'empty_data ' => null ,
186
+ ]);
171
187
172
188
$ this ->assertSame ('firstName ' , $ builder ->getName ());
173
189
$ this ->assertFalse ($ builder ->getOption ('required ' ));
@@ -179,7 +195,9 @@ public function testCreateBuilderUsesPatternIfFound()
179
195
$ this ->guesser1 ->configurePatternGuess ('[a-z] ' , Guess::MEDIUM_CONFIDENCE );
180
196
$ this ->guesser2 ->configurePatternGuess ('[a-zA-Z] ' , Guess::HIGH_CONFIDENCE );
181
197
182
- $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' );
198
+ $ builder = $ this ->factory ->createBuilderForProperty ('Application\Author ' , 'firstName ' , null , [
199
+ 'empty_data ' => null ,
200
+ ]);
183
201
184
202
$ this ->assertSame ('firstName ' , $ builder ->getName ());
185
203
$ this ->assertSame (['pattern ' => '[a-zA-Z] ' ], $ builder ->getOption ('attr ' ));
0 commit comments