Skip to content

Commit b2a84e8

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [TwigBundle] fixed usage of getSource in tests Trim constant values in XmlFileLoader move test to the HttpKernel component [TwigBridge] fixed Twig_Source required argument
2 parents ecb5df9 + 0954a18 commit b2a84e8

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;
@@ -51,4 +52,18 @@ public function testGetContainerExtensionWithInvalidClass()
5152
$bundle = new ExtensionNotValidBundle();
5253
$bundle->getContainerExtension();
5354
}
55+
56+
public function testHttpKernelRegisterCommandsIgnoresCommandsThatAreRegisteredAsServices()
57+
{
58+
$container = new ContainerBuilder();
59+
$container->register('console.command.Symfony_Component_HttpKernel_Tests_Fixtures_ExtensionPresentBundle_Command_FooCommand', 'Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand');
60+
61+
$application = $this->getMock('Symfony\Component\Console\Application');
62+
// add() is never called when the found command classes are already registered as services
63+
$application->expects($this->never())->method('add');
64+
65+
$bundle = new ExtensionPresentBundle();
66+
$bundle->setContainer($container);
67+
$bundle->registerCommands($application);
68+
}
5469
}

0 commit comments

Comments
 (0)