Skip to content

Commit baad4da

Browse files
[HttpKernel] Don't reset on shutdown but in FrameworkBundle/Test/KernelTestCase
1 parent b6857ba commit baad4da

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Test;
1313

14+
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
1415
use Symfony\Component\Finder\Finder;
1516
use Symfony\Component\HttpKernel\KernelInterface;
1617

@@ -171,7 +172,11 @@ protected static function createKernel(array $options = array())
171172
protected static function ensureKernelShutdown()
172173
{
173174
if (null !== static::$kernel) {
175+
$container = static::$kernel->getContainer();
174176
static::$kernel->shutdown();
177+
if ($container instanceof ResettableContainerInterface) {
178+
$container->reset();
179+
}
175180
}
176181
}
177182

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
2424
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
2525
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
26-
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
2726
use Symfony\Component\HttpFoundation\Request;
2827
use Symfony\Component\HttpFoundation\Response;
2928
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
@@ -171,10 +170,6 @@ public function shutdown()
171170
$bundle->setContainer(null);
172171
}
173172

174-
if ($this->container instanceof ResettableContainerInterface) {
175-
$this->container->reset();
176-
}
177-
178173
$this->container = null;
179174
}
180175

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy