Skip to content

Commit 36da66d

Browse files
committed
fix kernel resolution for symfony 2.8 also
1 parent bd53b0a commit 36da66d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Functional/BaseTestCase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Cmf\Component\Testing\Functional\DbManager\PhpcrDecorator;
1818
use Symfony\Component\DependencyInjection\ContainerInterface;
1919
use Symfony\Component\HttpFoundation\Response;
20+
use Symfony\Component\HttpKernel\KernelInterface;
2021

2122
/**
2223
* The base class for Functional and Web tests.
@@ -80,12 +81,15 @@ public function getContainer()
8081
/**
8182
* Ensures the kernel is available.
8283
*
83-
* @return \Symfony\Component\HttpKernel\KernelInterface
84+
* @return KernelInterface
8485
*/
8586
public function getKernel()
8687
{
8788
if (null === self::$kernel) {
88-
self::$kernel = parent::bootKernel();
89+
$kernel = parent::bootKernel();
90+
if ($kernel instanceof KernelInterface) {
91+
self::$kernel = $kernel;
92+
}
8993
}
9094
if (!self::$kernel->getContainer()) {
9195
self::$kernel->boot();

0 commit comments

Comments
 (0)