2929use Symfony \Bridge \Doctrine \Tests \Fixtures \SingleIntIdNoToStringEntity ;
3030use Symfony \Bridge \Doctrine \Tests \Fixtures \SingleStringCastableIdEntity ;
3131use Symfony \Bridge \Doctrine \Tests \Fixtures \SingleStringIdEntity ;
32+ use Symfony \Component \Form \ChoiceList \Loader \ChoiceLoaderInterface ;
3233use Symfony \Component \Form \ChoiceList \View \ChoiceGroupView ;
3334use Symfony \Component \Form \ChoiceList \View \ChoiceView ;
35+ use Symfony \Component \Form \Exception \RuntimeException ;
36+ use Symfony \Component \Form \Exception \UnexpectedTypeException ;
3437use Symfony \Component \Form \Forms ;
3538use Symfony \Component \Form \Tests \Extension \Core \Type \BaseTypeTest ;
3639use Symfony \Component \Form \Tests \Extension \Core \Type \FormTypeTest ;
40+ use Symfony \Component \OptionsResolver \Exception \InvalidOptionsException ;
41+ use Symfony \Component \OptionsResolver \Exception \MissingOptionsException ;
3742
3843class EntityTypeTest extends BaseTypeTest
3944{
@@ -118,13 +123,13 @@ protected function persist(array $entities)
118123
119124 public function testClassOptionIsRequired ()
120125 {
121- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ MissingOptionsException::class);
126+ $ this ->expectException (MissingOptionsException::class);
122127 $ this ->factory ->createNamed ('name ' , static ::TESTED_TYPE );
123128 }
124129
125130 public function testInvalidClassOption ()
126131 {
127- $ this ->expectException (\ Symfony \ Component \ Form \ Exception \ RuntimeException::class);
132+ $ this ->expectException (RuntimeException::class);
128133 $ this ->factory ->createNamed ('name ' , static ::TESTED_TYPE , null , [
129134 'class ' => 'foo ' ,
130135 ]);
@@ -219,7 +224,7 @@ public function testSetDataToUninitializedEntityWithNonRequiredQueryBuilder()
219224
220225 public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure ()
221226 {
222- $ this ->expectException (\ Symfony \ Component \ OptionsResolver \ Exception \ InvalidOptionsException::class);
227+ $ this ->expectException (InvalidOptionsException::class);
223228 $ this ->factory ->createNamed ('name ' , static ::TESTED_TYPE , null , [
224229 'em ' => 'default ' ,
225230 'class ' => self ::SINGLE_IDENT_CLASS ,
@@ -229,7 +234,7 @@ public function testConfigureQueryBuilderWithNonQueryBuilderAndNonClosure()
229234
230235 public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder ()
231236 {
232- $ this ->expectException (\ Symfony \ Component \ Form \ Exception \ UnexpectedTypeException::class);
237+ $ this ->expectException (UnexpectedTypeException::class);
233238 $ field = $ this ->factory ->createNamed ('name ' , static ::TESTED_TYPE , null , [
234239 'em ' => 'default ' ,
235240 'class ' => self ::SINGLE_IDENT_CLASS ,
@@ -1242,7 +1247,7 @@ public function testLoaderCaching()
12421247 $ choiceLoader2 = $ form ->get ('property2 ' )->getConfig ()->getOption ('choice_loader ' );
12431248 $ choiceLoader3 = $ form ->get ('property3 ' )->getConfig ()->getOption ('choice_loader ' );
12441249
1245- $ this ->assertInstanceOf (\ Symfony \ Component \ Form \ ChoiceList \ Loader \ ChoiceLoaderInterface::class, $ choiceLoader1 );
1250+ $ this ->assertInstanceOf (ChoiceLoaderInterface::class, $ choiceLoader1 );
12461251 $ this ->assertSame ($ choiceLoader1 , $ choiceLoader2 );
12471252 $ this ->assertSame ($ choiceLoader1 , $ choiceLoader3 );
12481253 }
@@ -1302,14 +1307,14 @@ public function testLoaderCachingWithParameters()
13021307 $ choiceLoader2 = $ form ->get ('property2 ' )->getConfig ()->getOption ('choice_loader ' );
13031308 $ choiceLoader3 = $ form ->get ('property3 ' )->getConfig ()->getOption ('choice_loader ' );
13041309
1305- $ this ->assertInstanceOf (\ Symfony \ Component \ Form \ ChoiceList \ Loader \ ChoiceLoaderInterface::class, $ choiceLoader1 );
1310+ $ this ->assertInstanceOf (ChoiceLoaderInterface::class, $ choiceLoader1 );
13061311 $ this ->assertSame ($ choiceLoader1 , $ choiceLoader2 );
13071312 $ this ->assertSame ($ choiceLoader1 , $ choiceLoader3 );
13081313 }
13091314
13101315 protected function createRegistryMock ($ name , $ em )
13111316 {
1312- $ registry = $ this ->getMockBuilder (ManagerRegistry::class)-> getMock ( );
1317+ $ registry = $ this ->createMock (ManagerRegistry::class);
13131318 $ registry ->expects ($ this ->any ())
13141319 ->method ('getManager ' )
13151320 ->with ($ this ->equalTo ($ name ))
0 commit comments