Skip to content

Commit 4ee70f9

Browse files
committed
Replace kernel reboot with actual boot to reset services
1 parent e11bf68 commit 4ee70f9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Codeception/Lib/Connector/Symfony.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ public function __construct(
3131
parent::__construct($kernel);
3232
$this->followRedirects();
3333
$this->container = $this->getContainer();
34-
$this->rebootKernel();
34+
$this->rebootKernel(); // Ensure the profiler exists
3535
}
3636

3737
/** @param Request $request */
3838
protected function doRequest(object $request): Response
3939
{
40-
if ($this->rebootable) {
41-
if ($this->hasPerformedRequest) {
42-
$this->rebootKernel();
43-
} else {
44-
$this->hasPerformedRequest = true;
45-
}
40+
if ($this->hasPerformedRequest && $this->rebootable) {
41+
$this->rebootKernel();
42+
} else {
43+
$this->hasPerformedRequest = true;
4644
}
4745

4846
return parent::doRequest($request);
@@ -66,7 +64,9 @@ public function rebootKernel(): void
6664
}
6765

6866
$this->persistDoctrineConnections();
69-
$this->kernel->reboot(null);
67+
$this->kernel->boot();
68+
$this->kernel->shutdown();
69+
$this->kernel->boot();
7070
$this->container = $this->getContainer();
7171

7272
foreach ($this->persistentServices as $serviceName => $service) {

0 commit comments

Comments
 (0)