Closed
Description
I've create some assertion methods, including those:
assertResponseIsRedirect(Response $response, string $message = ''): void
assertRedirectResponseIsPermanent(RedirectResponse $response, string $message = ''): void
If I create a functional test making a request with Symfony, I want to check if the response is a redirect (with instanceof
in my assertion method) and then I want to check if the redirection is permanent:
$response = $this->client->getResponse();
self::assertResponseIsRedirect($response);
self::assertRedirectResponseIsPermanent($response);
If I run PHPStan, I get the following error:
Parameter #1 $response of static method Path\To\TestCase::assertRedirectResponseIsPermanent() expects Symfony\Component\HttpFoundation\RedirectResponse, Symfony\Component\HttpFoundation\Response given.
Is there any way to add a custom expression resolver to AssertTypeSpecifyingExtensionHelper so I can get rid of this error?
Metadata
Metadata
Assignees
Labels
No labels