From 9ae1957fb817c0fec6d171931f675895a434d988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Fri, 20 Sep 2024 10:11:35 +0200 Subject: [PATCH] [FrameworkBundle] Do not access the container when the kernel is shut down --- Test/KernelTestCase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php index 89dbd40af..d44d77b67 100644 --- a/Test/KernelTestCase.php +++ b/Test/KernelTestCase.php @@ -157,14 +157,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(); }