File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \HttpKernel \Tests \Bundle ;
13
13
14
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
14
15
use Symfony \Component \HttpKernel \Tests \Fixtures \ExtensionNotValidBundle \ExtensionNotValidBundle ;
15
16
use Symfony \Component \HttpKernel \Tests \Fixtures \ExtensionPresentBundle \ExtensionPresentBundle ;
16
17
use Symfony \Component \HttpKernel \Tests \Fixtures \ExtensionAbsentBundle \ExtensionAbsentBundle ;
@@ -41,4 +42,18 @@ public function testGetContainerExtensionWithInvalidClass()
41
42
$ bundle = new ExtensionNotValidBundle ();
42
43
$ bundle ->getContainerExtension ();
43
44
}
45
+
46
+ public function testHttpKernelRegisterCommandsIgnoresCommandsThatAreRegisteredAsServices ()
47
+ {
48
+ $ container = new ContainerBuilder ();
49
+ $ container ->register ('console.command.Symfony_Component_HttpKernel_Tests_Fixtures_ExtensionPresentBundle_Command_FooCommand ' , 'Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand ' );
50
+
51
+ $ application = $ this ->getMock ('Symfony\Component\Console\Application ' );
52
+ // add() is never called when the found command classes are already registered as services
53
+ $ application ->expects ($ this ->never ())->method ('add ' );
54
+
55
+ $ bundle = new ExtensionPresentBundle ();
56
+ $ bundle ->setContainer ($ container );
57
+ $ bundle ->registerCommands ($ application );
58
+ }
44
59
}
You can’t perform that action at this time.
0 commit comments