You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests: allow the test suite to run on PHPUnit 8.x and 9.x
Includes:
* `composer.json`: widening the PHPUnit requirement to allow for PHPUnit 8.x and PHPUnit 9.x.
Note: The recently released PHPUnit 10.x is not (yet) supported as it no longer supports the old-style test suite runner setup.
It also would require for the abstract base test cases to be renamed as those classes are no longer allowed to end on `Test`.
Refactoring the test suite to allow for PHPUnit 10.x is for a future PR.
* `composer.json`: remove the script which was specific for PHP 8.1+
* Adjusting the PHPUnit configuration to ensure the tests are run in the same way and show all notices/warnings/deprecations on all PHPUnit versions.
The default value for a number of configuration options has changed over time.
This makes sure they are consistently set to values which are sensible for this codebase, independently of the PHPUnit version on which the tests are run.
Includes adding a schema annotation (set to PHPUnit 9.2 as the schema has changed in PHPUnit 9.3, though that won't prevent the tests from running correctly).
* GH Actions `test`/`quicktest` workflow: removing work-arounds which were in place related to running PHPUnit 7.x on PHP 8.x.
* GH Actions `phpstan` workflow: let PHPStan run on the latest PHP version, now there's no need anymore to run it against a lower PHP version to prevent deprecation notices related to the use of an outdated PHPUnit version.
* `AllTests`: Adjusting the condition which determines which `TestSuite` file to load to allow for PHPUnit 8.x and 9.x.
* Adding the `.phpunit.result.cache` file to `.gitignore`.
PHPUnit has a caching feature build in as of PHPUnit 8, so ignore the file that generates to prevent it from being committed.
* CONTRIBUTING: remove references to the remove Composer script + instructions which have now become redundant.
Related to 3395
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,6 @@ Note: There may be an issue or PR open already. If so, please join the discussio
137
137
138
138
1. Fork/clone the repository.
139
139
2. Run `composer install`.
140
-
When installing on PHP >= 8.0, use `composer install --ignore-platform-req=php+`.
141
140
3. Create a new branch off the `master` branch to hold your patch.
142
141
If there is an open issue associated with your patch, including the issue number in the branch name is good practice.
143
142
@@ -152,10 +151,8 @@ To help you with this, a number of convenience scripts are available:
152
151
*`composer check-all` will run the `cs` + `test` checks in one go.
153
152
*`composer cs` will check for code style violations.
154
153
*`composer cbf` will run the autofixers for code style violations.
155
-
*`composer test` will run the unit tests (only works when on PHP < 8.1).
156
-
*`composer test-php8` will run the unit tests when you are working on PHP 8.1+.
157
-
Please note that using a `phpunit.xml` overload config file will not work with this script!
158
-
*`composer coverage` will run the unit tests with code coverage (only works when on PHP < 8.1).
154
+
*`composer test` will run the unit tests.
155
+
*`composer coverage` will run the unit tests with code coverage.
159
156
Note: you may want to use a custom `phpunit.xml` overload config file to tell PHPUnit where to place an HTML report.
160
157
Alternative run it like so: `composer coverage -- --coverage-html /path/to/report-dir/` to specify the location for the HTML report on the command line.
161
158
*`composer build` will build the phpcs.phar and phpcbf.phar files.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,9 @@ The file documents changes to the PHP_CodeSniffer project.
36
36
- PSR2.Methods.FunctionCallSignature
37
37
- PSR2.Methods.FunctionClosingBrace
38
38
- Thanks to Atsushi Okui (@blue32a) for the patch
39
+
- Support for PHPUnit 8 and 9 to the test suite.
40
+
- Test suites for external standards which run via the PHPCS native test suite can now run on PHPUnit 4-9 (was 4-7).
41
+
- If any of these tests use the PHPUnit `setUp()`/`tearDown()` methods or overload the `setUp()` in the `AbstractSniffUnitTest` test case, they will need to be adjusted. See the [PR details for further information](https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/59/commits/26384ebfcc0b1c1651b0e1e40c9b6c8c22881832).
39
42
40
43
### Changed
41
44
- Changes have been made to the way PHPCS handles invalid sniff properties being set in a custom ruleset
0 commit comments