Introducing the PHPStan Rule Test Helper
The PHPStan Rule Test Helper is an open source library that makes tests for custom PHPStan rules easier to write and maintain, by removing line numbers and duplicated error messages from tests.
The PHPStan Rule Test Helper makes tests for custom PHPStan rules easier to write and maintain, by removing line numbers and duplicated error messages from tests.
DaveLiddament/phpstan-rule-test-helper View on GitHub
The PHPStan Rule Test Helper builds on PHPStan's own test harness for custom rules. Expected errors are marked with // ERROR comments in the fixture files themselves, so there are no line numbers to update when a fixture changes. The expected error message can also be defined once in the test case, rather than repeated for every violation.
The PHPStan Rule Test Helper is an open source library that makes tests for custom PHPStan rules easier to write and maintain, by removing line numbers and duplicated error messages from tests.