We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8dbdfc commit a2c8650Copy full SHA for a2c8650
Test/KernelTestCase.php
@@ -14,6 +14,7 @@
14
use PHPUnit\Framework\TestCase;
15
use Symfony\Component\DependencyInjection\ContainerInterface;
16
use Symfony\Component\HttpKernel\KernelInterface;
17
+use Symfony\Contracts\Service\ResetInterface;
18
19
/**
20
* KernelTestCase is the base class for tests needing a Kernel.
@@ -131,8 +132,13 @@ protected static function ensureKernelShutdown()
131
132
{
133
if (null !== static::$kernel) {
134
static::$kernel->boot();
135
+ $container = static::$kernel->getContainer();
136
static::$kernel->shutdown();
137
static::$booted = false;
138
+
139
+ if ($container instanceof ResetInterface) {
140
+ $container->reset();
141
+ }
142
}
143
144
static::$container = null;
0 commit comments