Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  [FrameworkBundle] Do not access the container when the kernel is shut down
  • Loading branch information
xabbuh committed Sep 20, 2024
2 parents f40274b + 9ae1957 commit 6a9665b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Test/KernelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,15 @@ protected static function ensureKernelShutdown()
if (null !== static::$kernel) {
static::$kernel->boot();
$container = static::$kernel->getContainer();
static::$kernel->shutdown();
static::$booted = false;

if ($container->has('services_resetter')) {
// Instantiate the service because Container::reset() only resets services that have been used
$container->get('services_resetter');
}

static::$kernel->shutdown();
static::$booted = false;

if ($container instanceof ResetInterface) {
$container->reset();
}
Expand Down

0 comments on commit 6a9665b

Please sign in to comment.