Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ae1957

Browse files
committed
[FrameworkBundle] Do not access the container when the kernel is shut down
1 parent d022058 commit 9ae1957

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Test/KernelTestCase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ protected static function ensureKernelShutdown()
157157
if (null !== static::$kernel) {
158158
static::$kernel->boot();
159159
$container = static::$kernel->getContainer();
160-
static::$kernel->shutdown();
161-
static::$booted = false;
162160

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

166+
static::$kernel->shutdown();
167+
static::$booted = false;
168+
168169
if ($container instanceof ResetInterface) {
169170
$container->reset();
170171
}

0 commit comments

Comments
 (0)