Skip to content

Commit 02d4200

Browse files
Merge branch '7.2' into 7.3
* 7.2: cs tweak [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass Revert "bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
2 parents a784ff8 + 959b0ff commit 02d4200

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
102102
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
103103
if [[ ! "${{ matrix.mode }}" = *-deps ]]; then
104-
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit
104+
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit
105105
else
106106
echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV
107107
cp composer.json composer.json.orig

src/Symfony/Bundle/FrameworkBundle/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy