Skip to content

Commit 59eda81

Browse files
Merge branch '4.4' into 5.4
* 4.4: [VarDumper] Fix dumping mysqli_driver instances Fix missing ReturnTypeWillChange attributes [Cache] Add missing log when saving namespace [HttpKernel] Reset services between requests performed by KernelBrowser [HttpKernel] Remove unused argument in ArgumentMetadataFactory
2 parents 443b983 + 353bc8a commit 59eda81

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

KernelBrowser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\HttpKernel\KernelInterface;
2323
use Symfony\Component\HttpKernel\Profiler\Profile as HttpProfile;
2424
use Symfony\Component\Security\Core\User\UserInterface;
25+
use Symfony\Contracts\Service\ResetInterface;
2526

2627
/**
2728
* Simulates a browser and makes requests to a Kernel object.
@@ -167,7 +168,12 @@ protected function doRequest(object $request)
167168
// avoid shutting down the Kernel if no request has been performed yet
168169
// WebTestCase::createClient() boots the Kernel but do not handle a request
169170
if ($this->hasPerformedRequest && $this->reboot) {
171+
$container = $this->kernel->getContainer();
170172
$this->kernel->shutdown();
173+
174+
if ($container instanceof ResetInterface) {
175+
$container->reset();
176+
}
171177
} else {
172178
$this->hasPerformedRequest = true;
173179
}
@@ -218,7 +224,7 @@ protected function getScript(object $request)
218224

219225
$requires = '';
220226
foreach (get_declared_classes() as $class) {
221-
if (0 === strpos($class, 'ComposerAutoloaderInit')) {
227+
if (str_starts_with($class, 'ComposerAutoloaderInit')) {
222228
$r = new \ReflectionClass($class);
223229
$file = \dirname($r->getFileName(), 2).'/autoload.php';
224230
if (is_file($file)) {

Tests/KernelBrowserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testEnableRebootKernel()
5454
private function getKernelMock()
5555
{
5656
$mock = $this->getMockBuilder($this->getKernelClass())
57-
->setMethods(['shutdown', 'boot', 'handle'])
57+
->setMethods(['shutdown', 'boot', 'handle', 'getContainer'])
5858
->disableOriginalConstructor()
5959
->getMock();
6060

0 commit comments

Comments
 (0)