Skip to content

Commit e68f88c

Browse files
committed
[FrameworkBundle] Do not access the container when the kernel is shut down
1 parent 8797be8 commit e68f88c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

+3-2
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)