mirror of
https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2026-07-26 10:26:58 +08:00
As of PHPCS 4.0, the base sniff test class has been renamed from `AbstractSniffUnitTest` to `AbstractSniffTestCase`. Additionally, the PHPCS test setup no longer uses the outdated custom test suite creation. This means that to allow for the tests to run on both PHPCS 3.x and 4.x, some changes are needed. This commit handles this by: * Changing all test files to `extend` the new test case class and adding a class alias to the test bootstrap for compatibility with PHPCS 3.x. * Adding separate scripts to the `composer.json` file for invoking the tests on PHPCS 3.x vs 4.x. * Updating the minimum PHPUnit 9 version to 9.3.4 as required by the PHPCS 4.x native test framework. * Add GH Actions jobs to test against PHPCS 4.x to all `test` matrices. * Updating the `quicktest` and `unit-tests` GH Actions jobs to use the correct Composer script based on the installed PHPCS version. * Run the `basic-qa` code-sniff and ruleset-test jobs against both PHPCS 3.x-dev and 4.x-dev. * Update `basic-qa` to accept the phpcbf NON_FIXABLE exit code (2) on PHPCS 4.x in the fixer-conflict check. PHPCS 4.0 reworked the phpcbf exit codes into a bitmask. _Note: even though PHPCS 4.x supports PHPUnit 10 and 11, we cannot widen the version restrictions for PHPUnit (yet) while PHPCS 3.x is also supported as it would lead to PHPUnit 10/11 being installed for PHPCS 3.x on PHP >= 8.1, which would break the test runs._ --------- Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| RulesetCheck | ||
| bootstrap.php | ||