diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php index 6d12d5fa8..ee67fa7af 100644 --- a/Test/KernelTestCase.php +++ b/Test/KernelTestCase.php @@ -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(); }