diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index 442649ac1bac4..b87018bbd6b3f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -44,6 +44,7 @@ abstract class KernelTestCase extends TestCase private function doTearDown() { static::ensureKernelShutdown(); + static::$class = null; static::$kernel = null; static::$booted = false; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TestServiceContainerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TestServiceContainerTest.php index bf4f9f8779f44..4122a749dfd1d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TestServiceContainerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TestServiceContainerTest.php @@ -44,4 +44,22 @@ public function testThatPrivateServicesAreAvailableIfTestConfigIsEnabled() $this->assertTrue(static::$container->has('private_service')); $this->assertFalse(static::$container->has(UnusedPrivateService::class)); } + + /** + * @doesNotPerformAssertions + */ + public function testBootKernel() + { + static::bootKernel(['test_case' => 'TestServiceContainer']); + } + + /** + * @depends testBootKernel + */ + public function testKernelIsNotInitialized() + { + self::assertNull(self::$class); + self::assertNull(self::$kernel); + self::assertFalse(self::$booted); + } }