12
12
namespace Symfony \Component \Form \Tests ;
13
13
14
14
use Symfony \Component \Form \Extension \Core \DataMapper \PropertyPathMapper ;
15
+ use Symfony \Component \Form \Extension \Core \Type \TextType ;
15
16
use Symfony \Component \Form \Extension \HttpFoundation \HttpFoundationRequestHandler ;
16
17
use Symfony \Component \Form \FormError ;
17
18
use Symfony \Component \Form \Forms ;
@@ -172,13 +173,13 @@ public function testAddUsingNameAndType()
172
173
173
174
$ this ->factory ->expects ($ this ->once ())
174
175
->method ('createNamed ' )
175
- ->with ('foo ' , ' text ' , null , array (
176
+ ->with ('foo ' , TextType::class , null , array (
176
177
'bar ' => 'baz ' ,
177
178
'auto_initialize ' => false ,
178
179
))
179
180
->will ($ this ->returnValue ($ child ));
180
181
181
- $ this ->form ->add ('foo ' , ' text ' , array ('bar ' => 'baz ' ));
182
+ $ this ->form ->add ('foo ' , TextType::class , array ('bar ' => 'baz ' ));
182
183
183
184
$ this ->assertTrue ($ this ->form ->has ('foo ' ));
184
185
$ this ->assertSame ($ this ->form , $ child ->getParent ());
@@ -191,14 +192,14 @@ public function testAddUsingIntegerNameAndType()
191
192
192
193
$ this ->factory ->expects ($ this ->once ())
193
194
->method ('createNamed ' )
194
- ->with ('0 ' , ' text ' , null , array (
195
+ ->with ('0 ' , TextType::class , null , array (
195
196
'bar ' => 'baz ' ,
196
197
'auto_initialize ' => false ,
197
198
))
198
199
->will ($ this ->returnValue ($ child ));
199
200
200
201
// in order to make casting unnecessary
201
- $ this ->form ->add (0 , ' text ' , array ('bar ' => 'baz ' ));
202
+ $ this ->form ->add (0 , TextType::class , array ('bar ' => 'baz ' ));
202
203
203
204
$ this ->assertTrue ($ this ->form ->has (0 ));
204
205
$ this ->assertSame ($ this ->form , $ child ->getParent ());
@@ -211,7 +212,7 @@ public function testAddWithoutType()
211
212
212
213
$ this ->factory ->expects ($ this ->once ())
213
214
->method ('createNamed ' )
214
- ->with ('foo ' , ' text ' )
215
+ ->with ('foo ' , TextType::class )
215
216
->will ($ this ->returnValue ($ child ));
216
217
217
218
$ this ->form ->add ('foo ' );
0 commit comments