Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 608b1dd

Browse filesBrowse files
[FrameworkBundle] Ensure container is reset between tests
1 parent c3ba272 commit 608b1dd
Copy full SHA for 608b1dd

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
1616
use Symfony\Component\HttpKernel\KernelInterface;
17+
use Symfony\Contracts\Service\ResetInterface;
1718

1819
/**
1920
* KernelTestCase is the base class for tests needing a Kernel.
@@ -131,8 +132,13 @@ protected static function ensureKernelShutdown()
131132
{
132133
if (null !== static::$kernel) {
133134
static::$kernel->boot();
135+
$container = static::$kernel->getContainer();
134136
static::$kernel->shutdown();
135137
static::$booted = false;
138+
139+
if ($container instanceof ResetInterface) {
140+
$container->reset();
141+
}
136142
}
137143

138144
static::$container = null;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.