Title: Mocking multiple types reports errors with phpstan 0.12 · Issue #58 · phpstan/phpstan-phpunit · GitHub
Open Graph Title: Mocking multiple types reports errors with phpstan 0.12 · Issue #58 · phpstan/phpstan-phpunit
X Title: Mocking multiple types reports errors with phpstan 0.12 · Issue #58 · phpstan/phpstan-phpunit
Description: Calling createMock with multiple Types causes phpstan to report errors: A class like c...
Open Graph Description: Calling createMock with multiple Types causes phpstan to report errors: A class like
X Description: Calling createMock with multiple Types causes phpstan to report errors: A class like <?php declare(strict_types=1); namespace App; use PHPUnit\Framework\TestCase; class Test extends TestCase { p...
Opengraph URL: https://github.com/phpstan/phpstan-phpunit/issues/58
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mocking multiple types reports errors with phpstan 0.12","articleBody":"Calling `createMock` with multiple Types causes phpstan to report errors:\r\n\r\nA class like \r\n```\r\n\u003c?php declare(strict_types=1);\r\n\r\nnamespace App;\r\n\r\nuse PHPUnit\\Framework\\TestCase;\r\n\r\nclass Test extends TestCase\r\n{\r\n\r\n public function testDummy(): void {\r\n $this->createMock([\\DateTimeInterface::class, \\ArrayAccess::class]);\r\n }\r\n}\r\n\r\n```\r\n\r\nthrows the following errors:\r\n\r\n```\r\n ------ ------------------------------------------------------------------------------------------------------------------------------------------------- \r\n Line Test.php \r\n ------ ------------------------------------------------------------------------------------------------------------------------------------------------- \r\n 11 Parameter #1 $originalClassName of method PHPUnit\\Framework\\TestCase::createMock() expects class-string\u003cmixed>, array\u003cint, class-string> given. \r\n 11 Unable to resolve the template type T in call to method PHPUnit\\Framework\\TestCase::createMock() \r\n ------ ------------------------------------------------------------------------------------------------------------------------------------------------- \r\n\r\n```\r\n\r\nThe error also occurs, if there is only one class given, but not as a string, but as an array:\r\n`$this->createMock([\\DateTimeInterface::class]);` produces the same error.\r\n\r\nThis is working fine in phpstan 0.11","author":{"url":"https://github.com/Khartir","@type":"Person","name":"Khartir"},"datePublished":"2020-01-17T14:42:18Z","url":"https://github.com/phpstan/phpstan-phpunit/issues/58"}
| 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:c8185c30-6795-af76-fb95-812f2e2a32c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFEC:330B9D:1C9EB8:26F447:6B006622 |
| html-safe-nonce | 7eee9db5fdbc82d6a88ad47cf72ac6c8dba1582af46ac40273b53998bd0a5165 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkVDOjMzMEI5RDoxQzlFQjg6MjZGNDQ3OjZCMDA2NjIyIiwidmlzaXRvcl9pZCI6IjY1MzU4MjA3NzMxNDYyNTY5MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a3ae372ad806c052364f52e847456986fbb2e1863021edbb2dafbf381b7b05f8 |
| hovercard-subject-tag | issue:551453605 |
| 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/58/issue_layout |
| twitter:image | https://opengraph.githubassets.com/88dbace54ace3b73d7ed098e6b52ad2ad589b3488e3468c8da0edd312f73dc42/phpstan/phpstan-phpunit/issues/58 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/88dbace54ace3b73d7ed098e6b52ad2ad589b3488e3468c8da0edd312f73dc42/phpstan/phpstan-phpunit/issues/58 |
| og:image:alt | Calling createMock with multiple Types causes phpstan to report errors: A class like |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Khartir |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25854482a1773a7c1ebb8be3d2bc1c6e61d82d78126be63b5044474a86d44d9e |
| 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 | e4f5c239e31f1f680e6bbc419ff92d774da616ec |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width