From 30bcb572862bf486f9f33a2519e69d62e37a4014 Mon Sep 17 00:00:00 2001 From: Josiah Truasheim Date: Wed, 1 Aug 2012 09:25:05 +0700 Subject: [PATCH] Added a test case to demonstrate the fatal error occuring when a Bundle implementing BundleInterface only is registered in the kernel. --- .../Tests/Console/ApplicationTest.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php new file mode 100644 index 0000000000..089e19157f --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Console; + +use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Output\NullOutput; + +class ApplicationTest extends TestCase +{ + public function testBundleInterfaceImplementation() + { + $bundle = $this->getMock("Symfony\Component\HttpKernel\Bundle\BundleInterface"); + + $kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface"); + $kernel + ->expects($this->any()) + ->method('getBundles') + ->will($this->returnValue(array($bundle))) + ; + + $application = new Application($kernel); + $application->doRun(new ArrayInput(array('list')), new NullOutput()); + } +}