Title: Rule to enforce class naming · Issue #214 · phpstan/phpstan-phpunit · GitHub
Open Graph Title: Rule to enforce class naming · Issue #214 · phpstan/phpstan-phpunit
X Title: Rule to enforce class naming · Issue #214 · phpstan/phpstan-phpunit
Description: Generally speaking PHPUnit looks for tests in files named *Test.php, which conventionally means the classes should be named *Test. Additionally I believe it is recommended/required (I cannot find docs for this) that "tests" designed to b...
Open Graph Description: Generally speaking PHPUnit looks for tests in files named *Test.php, which conventionally means the classes should be named *Test. Additionally I believe it is recommended/required (I cannot find d...
X Description: Generally speaking PHPUnit looks for tests in files named *Test.php, which conventionally means the classes should be named *Test. Additionally I believe it is recommended/required (I cannot find d...
Opengraph URL: https://github.com/phpstan/phpstan-phpunit/issues/214
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rule to enforce class naming","articleBody":"Generally speaking PHPUnit looks for tests in files named `*Test.php`, which conventionally means the classes should be named `*Test`. Additionally I believe it is recommended/required (I cannot find docs for this) that \"tests\" designed to be extended should be named `*TestCase`.\r\n\r\nI propose adding rule to this extension which enforces that classes are named appropriately:\r\n\r\n* If a concrete class extends `PHPUnit\\Framework\\TestCase` and it should be named `*Test` - could also enforce `final`?\r\n* If an abstract class extends `PHPUnit\\Framework\\TestCase` it should be named `*TestCase`.\r\n\r\nIdeally the rule would also enforce the file is named appropriately as well but that might be outside scope.\r\n\r\nIf this convention isn't followed and you don't explicitly tell PHPUnit your test files then tests are not run, potentially keeping the build passing because a number of tests are being silently ignored.","author":{"url":"https://github.com/cs278","@type":"Person","name":"cs278"},"datePublished":"2024-11-26T18:14:49Z","url":"https://github.com/phpstan/phpstan-phpunit/issues/214"}
| 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:52119a6d-ce0b-2934-dddf-b005443bc598 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A4CC:2D74E0:4CDFFA:6924B8:6B007274 |
| html-safe-nonce | 7d321b5b932d93bd9cfb875f339c1a418cb1fc15734ba273781c8446949dfe6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNENDOjJENzRFMDo0Q0RGRkE6NjkyNEI4OjZCMDA3Mjc0IiwidmlzaXRvcl9pZCI6IjY0OTUzMTEzNDU5ODUwMjQ2MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b4f39e98d41d3cb3e2e98596541b86ea3c5440775d7e4c14f6a4b18cf3961d81 |
| hovercard-subject-tag | issue:2695648050 |
| 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/214/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5ed7b5e7b8adb48e51b29f807dd489604356b846d7933b2ecd8bd6428924ca0f/phpstan/phpstan-phpunit/issues/214 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5ed7b5e7b8adb48e51b29f807dd489604356b846d7933b2ecd8bd6428924ca0f/phpstan/phpstan-phpunit/issues/214 |
| og:image:alt | Generally speaking PHPUnit looks for tests in files named *Test.php, which conventionally means the classes should be named *Test. Additionally I believe it is recommended/required (I cannot find d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cs278 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16 |
| 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 | 84e563eb4b55f8fa102f325f117533cee9e3df4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width