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 592a00a

Browse filesBrowse files
[HttpKernel] Reset services between requests performed by KernelBrowser
1 parent 43820b7 commit 592a00a
Copy full SHA for 592a00a

File tree

2 files changed

+7
-1
lines changed
Filter options

2 files changed

+7
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Client.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\HttpKernel\HttpKernelBrowser;
2020
use Symfony\Component\HttpKernel\KernelInterface;
2121
use Symfony\Component\HttpKernel\Profiler\Profile as HttpProfile;
22+
use Symfony\Contracts\Service\ResetInterface;
2223

2324
/**
2425
* Client simulates a browser and makes requests to a Kernel object.
@@ -116,7 +117,12 @@ protected function doRequest($request)
116117
// avoid shutting down the Kernel if no request has been performed yet
117118
// WebTestCase::createClient() boots the Kernel but do not handle a request
118119
if ($this->hasPerformedRequest && $this->reboot) {
120+
$container = $this->kernel->getContainer();
119121
$this->kernel->shutdown();
122+
123+
if ($container instanceof ResetInterface) {
124+
$container->reset();
125+
}
120126
} else {
121127
$this->hasPerformedRequest = true;
122128
}

‎src/Symfony/Bundle/FrameworkBundle/Tests/KernelBrowserTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/KernelBrowserTest.php
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.