Title: Add a custom expression resolver for type specification · Issue #44 · phpstan/phpstan-phpunit · GitHub
Open Graph Title: Add a custom expression resolver for type specification · Issue #44 · phpstan/phpstan-phpunit
X Title: Add a custom expression resolver for type specification · Issue #44 · phpstan/phpstan-phpunit
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 functio...
Open Graph Description: I've create some assertion methods, including those: assertResponseIsRedirect(Response $response, string $message = ''): void assertRedirectResponseIsPermanent(RedirectResponse $response, string $m...
X Description: I've create some assertion methods, including those: assertResponseIsRedirect(Response $response, string $message = ''): void assertRedirectResponseIsPermanent(RedirectResponse $respons...
Opengraph URL: https://github.com/phpstan/phpstan-phpunit/issues/44
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a custom expression resolver for type specification","articleBody":"I've create some assertion methods, including those:\r\n\r\n```php\r\nassertResponseIsRedirect(Response $response, string $message = ''): void\r\nassertRedirectResponseIsPermanent(RedirectResponse $response, string $message = ''): void\r\n```\r\n\r\nIf I create a functional test making a request with Symfony, I want to check if [the response](https://github.com/symfony/symfony/blob/fdb0490a168202b4d33053f4f05c766fb4414dd6/src/Symfony/Component/HttpKernel/Client.php#L29) is a redirect (with `instanceof` in my assertion method) and then I want to check if the redirection is permanent:\r\n\r\n```php\r\n$response = $this->client->getResponse();\r\nself::assertResponseIsRedirect($response);\r\nself::assertRedirectResponseIsPermanent($response);\r\n```\r\n\r\nIf I run PHPStan, I get the following error:\r\n\r\n```\r\nParameter #1 $response of static method Path\\To\\TestCase::assertRedirectResponseIsPermanent() expects Symfony\\Component\\HttpFoundation\\RedirectResponse, Symfony\\Component\\HttpFoundation\\Response given.\r\n```\r\n\r\nIs there any way to add a custom expression resolver to [AssertTypeSpecifyingExtensionHelper](https://github.com/phpstan/phpstan-phpunit/blob/ec9408e03859f9c775663c14687a7d106e17c751/src/Type/PHPUnit/Assert/AssertTypeSpecifyingExtensionHelper.php) so I can get rid of this error?","author":{"url":"https://github.com/nesk","@type":"Person","name":"nesk"},"datePublished":"2019-03-27T17:12:08Z","url":"https://github.com/phpstan/phpstan-phpunit/issues/44"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:86d883b1-4747-0e92-e718-0ea202162763 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7B4:11842E:2F94BD:430440:6B006CFC |
| html-safe-nonce | ab2cf91170b3dc5e900e0f6719783a97b96a9703151c5d33fb3f20f92fc1e3b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0I0OjExODQyRToyRjk0QkQ6NDMwNDQwOjZCMDA2Q0ZDIiwidmlzaXRvcl9pZCI6IjcxOTQxNzkzMDE4Nzk2MDY1MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ff9c0aed51cbfa0a930196036bdc92dd598a325293bef27e47be1925303acafb |
| hovercard-subject-tag | issue:426084293 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpstan/phpstan-phpunit/44/issue_layout |
| twitter:image | https://opengraph.githubassets.com/152cc396907bf18f69f5c6d54cea92b71dd2ec46216e3e9b9b277ac59a3a500f/phpstan/phpstan-phpunit/issues/44 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/152cc396907bf18f69f5c6d54cea92b71dd2ec46216e3e9b9b277ac59a3a500f/phpstan/phpstan-phpunit/issues/44 |
| og:image:alt | I've create some assertion methods, including those: assertResponseIsRedirect(Response $response, string $message = ''): void assertRedirectResponseIsPermanent(RedirectResponse $response, string $m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nesk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| turbo-cache-control | no-preview |
| go-import | github.com/phpstan/phpstan-phpunit git https://github.com/phpstan/phpstan-phpunit.git |
| octolytics-dimension-user_id | 16435710 |
| octolytics-dimension-user_login | phpstan |
| octolytics-dimension-repository_id | 105883921 |
| octolytics-dimension-repository_nwo | phpstan/phpstan-phpunit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105883921 |
| octolytics-dimension-repository_network_root_nwo | phpstan/phpstan-phpunit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width