Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30bcb57

Browse files
committed
Added a test case to demonstrate the fatal error occuring when a Bundle implementing BundleInterface only is registered in the kernel.
1 parent 1da896d commit 30bcb57

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Console;
13+
14+
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
15+
use Symfony\Bundle\FrameworkBundle\Console\Application;
16+
use Symfony\Component\Console\Input\ArrayInput;
17+
use Symfony\Component\Console\Output\NullOutput;
18+
19+
class ApplicationTest extends TestCase
20+
{
21+
public function testBundleInterfaceImplementation()
22+
{
23+
$bundle = $this->getMock("Symfony\Component\HttpKernel\Bundle\BundleInterface");
24+
25+
$kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface");
26+
$kernel
27+
->expects($this->any())
28+
->method('getBundles')
29+
->will($this->returnValue(array($bundle)))
30+
;
31+
32+
$application = new Application($kernel);
33+
$application->doRun(new ArrayInput(array('list')), new NullOutput());
34+
}
35+
}

0 commit comments

Comments
 (0)