Skip to content

Commit 9b95333

Browse files
Merge branch '7.2' into 7.3
* 7.2: cs tweak [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass Revert "bug #60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
2 parents 983d5b6 + 20d4424 commit 9b95333

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Test/KernelTestCase.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Test;
1313

14-
use PHPUnit\Framework\Attributes\AfterClass;
1514
use PHPUnit\Framework\TestCase;
1615
use Symfony\Component\DependencyInjection\Container;
1716
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
@@ -40,6 +39,14 @@ protected function tearDown(): void
4039
static::$booted = false;
4140
}
4241

42+
public static function tearDownAfterClass(): void
43+
{
44+
static::ensureKernelShutdown();
45+
static::$class = null;
46+
static::$kernel = null;
47+
static::$booted = false;
48+
}
49+
4350
/**
4451
* @throws \RuntimeException
4552
* @throws \LogicException
@@ -113,11 +120,8 @@ protected static function createKernel(array $options = []): KernelInterface
113120

114121
/**
115122
* Shuts the kernel down if it was used in the test - called by the tearDown method by default.
116-
*
117-
* @afterClass
118123
*/
119-
#[AfterClass]
120-
public static function ensureKernelShutdown()
124+
protected static function ensureKernelShutdown()
121125
{
122126
if (null !== static::$kernel) {
123127
static::$kernel->boot();

0 commit comments

Comments
 (0)