Skip to content

Commit 0954a18

Browse files
committed
move test to the HttpKernel component
1 parent b783209 commit 0954a18

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tests/Bundle/BundleTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\Tests\Bundle;
1313

14+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1415
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionNotValidBundle\ExtensionNotValidBundle;
1516
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
1617
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionAbsentBundle\ExtensionAbsentBundle;
@@ -41,4 +42,18 @@ public function testGetContainerExtensionWithInvalidClass()
4142
$bundle = new ExtensionNotValidBundle();
4243
$bundle->getContainerExtension();
4344
}
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+
}
4459
}

0 commit comments

Comments
 (0)