Skip to content

Commit

Permalink
Update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
scheb committed Jun 1, 2021
1 parent 363a1ae commit 0e5e664
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,15 @@ private function createResponseEvent(): ResponseEvent
$kernel = $this->createMock(HttpKernelInterface::class);
$response = $this->createMock(Response::class);

if (\defined('Symfony\Component\HttpKernel\HttpKernelInterface::MAIN_REQUEST')) {
// Compatibility for Symfony >= 5.3
$requestType = HttpKernelInterface::MAIN_REQUEST;
} else {
$requestType = HttpKernelInterface::MASTER_REQUEST;
}

// Class is final, have to use a real instance instead of a mock
return new ResponseEvent($kernel, $this->request, HttpKernelInterface::MASTER_REQUEST, $response);
return new ResponseEvent($kernel, $this->request, $requestType, $response);
}

private function expectPrepareCurrentProvider(): void
Expand Down

0 comments on commit 0e5e664

Please sign in to comment.