@@ -36,49 +36,30 @@ public function testProcess()
3636
3737 $ controllers = $ container ->getDefinition ((string ) $ resolver ->getArgument (0 ))->getArgument (0 );
3838
39- $ this ->assertCount (2 , $ container ->getDefinition ((string ) $ controllers ['c1:fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
40- $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:setTestCase ' ]->getValues ()[0 ])->getArgument (0 ));
41- $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
39+ $ this ->assertCount (2 , $ container ->getDefinition ((string ) $ controllers ['c1:: fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
40+ $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:: setTestCase ' ]->getValues ()[0 ])->getArgument (0 ));
41+ $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:: fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
4242
4343 (new ResolveInvalidReferencesPass ())->process ($ container );
4444
45- $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:setTestCase ' ]->getValues ()[0 ])->getArgument (0 ));
46- $ this ->assertSame (array (), $ container ->getDefinition ((string ) $ controllers ['c2:fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
45+ $ this ->assertCount (1 , $ container ->getDefinition ((string ) $ controllers ['c2:: setTestCase ' ]->getValues ()[0 ])->getArgument (0 ));
46+ $ this ->assertSame (array (), $ container ->getDefinition ((string ) $ controllers ['c2:: fooAction ' ]->getValues ()[0 ])->getArgument (0 ));
4747
4848 (new RemoveEmptyControllerArgumentLocatorsPass ())->process ($ container );
4949
5050 $ controllers = $ container ->getDefinition ((string ) $ resolver ->getArgument (0 ))->getArgument (0 );
5151
52- $ this ->assertSame (array ('c1:fooAction ' ), array_keys ($ controllers ));
53- $ this ->assertSame (array ('bar ' ), array_keys ($ container ->getDefinition ((string ) $ controllers ['c1:fooAction ' ]->getValues ()[0 ])->getArgument (0 )));
52+ $ this ->assertSame (array ('c1::fooAction ' , ' c1: fooAction ' ), array_keys ($ controllers ));
53+ $ this ->assertSame (array ('bar ' ), array_keys ($ container ->getDefinition ((string ) $ controllers ['c1:: fooAction ' ]->getValues ()[0 ])->getArgument (0 )));
5454
5555 $ expectedLog = array (
56- 'Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass: Removing service-argument resolver for controller "c2:fooAction": no corresponding services exist for the referenced types. ' ,
56+ 'Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass: Removing service-argument resolver for controller "c2:: fooAction": no corresponding services exist for the referenced types. ' ,
5757 'Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass: Removing method "setTestCase" of service "c2" from controller candidates: the method is called at instantiation, thus cannot be an action. ' ,
5858 );
5959
6060 $ this ->assertSame ($ expectedLog , $ container ->getCompiler ()->getLog ());
6161 }
6262
63- public function testSameIdClass ()
64- {
65- $ container = new ContainerBuilder ();
66- $ resolver = $ container ->register ('argument_resolver.service ' )->addArgument (array ());
67-
68- $ container ->register (RegisterTestController::class, RegisterTestController::class)
69- ->addTag ('controller.service_arguments ' )
70- ;
71-
72- (new RegisterControllerArgumentLocatorsPass ())->process ($ container );
73- (new RemoveEmptyControllerArgumentLocatorsPass ())->process ($ container );
74-
75- $ expected = array (
76- RegisterTestController::class.':fooAction ' ,
77- RegisterTestController::class.'::fooAction ' ,
78- );
79- $ this ->assertEquals ($ expected , array_keys ($ container ->getDefinition ((string ) $ resolver ->getArgument (0 ))->getArgument (0 )));
80- }
81-
8263 public function testInvoke ()
8364 {
8465 $ container = new ContainerBuilder ();
@@ -92,30 +73,10 @@ public function testInvoke()
9273 (new RemoveEmptyControllerArgumentLocatorsPass ())->process ($ container );
9374
9475 $ this ->assertEquals (
95- array ('invokable:__invoke ' , 'invokable ' ),
76+ array ('invokable::__invoke ' , ' invokable: __invoke ' , 'invokable ' ),
9677 array_keys ($ container ->getDefinition ((string ) $ resolver ->getArgument (0 ))->getArgument (0 ))
9778 );
9879 }
99-
100- public function testInvokeSameIdClass ()
101- {
102- $ container = new ContainerBuilder ();
103- $ resolver = $ container ->register ('argument_resolver.service ' )->addArgument (array ());
104-
105- $ container ->register (InvokableRegisterTestController::class, InvokableRegisterTestController::class)
106- ->addTag ('controller.service_arguments ' )
107- ;
108-
109- (new RegisterControllerArgumentLocatorsPass ())->process ($ container );
110- (new RemoveEmptyControllerArgumentLocatorsPass ())->process ($ container );
111-
112- $ expected = array (
113- InvokableRegisterTestController::class.':__invoke ' ,
114- InvokableRegisterTestController::class.'::__invoke ' ,
115- InvokableRegisterTestController::class,
116- );
117- $ this ->assertEquals ($ expected , array_keys ($ container ->getDefinition ((string ) $ resolver ->getArgument (0 ))->getArgument (0 )));
118- }
11980}
12081
12182class RemoveTestController1
0 commit comments