8000 KernelTestCase resets internal state on tearDown · symfony/symfony@1f205d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f205d8

Browse files
committed
KernelTestCase resets internal state on tearDown
1 parent 3784dbc commit 1f205d8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ abstract class KernelTestCase extends TestCase
4747
protected function tearDown(): void
4848
{
4949
static::ensureKernelShutdown();
50+
static::$class = null;
5051
static::$kernel = null;
5152
static::$booted = false;
5253
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/KernelTestCaseTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,22 @@ public function testThatPrivateServicesAreAvailableIfTestConfigIsEnabled()
4141
$this->assertTrue($container->has('private_service'));
4242
$this->assertFalse($container->has(UnusedPrivateService::class));
4343
}
44+
45+
/**
46+
* @doesNotPerformAssertions
47+
*/
48+
public function testBootKernel(): void
49+
{
50+
static::bootKernel(['test_case' => 'TestServiceContainer']);
51+
}
52+
53+
/**
54+
* @depends testBootKernel
55+
*/
56+
public function testKernelIsNotInitialized(): void
57+
{
58+
self::assertNull(self::$class);
59+
self::assertNull(self::$kernel);
60+
self::assertFalse(self::$booted);
61+
}
4462
}

0 commit comments

Comments
 (0)
0