Travis: test against PHP 7.4, not 8.0 and fix PHPUnit failing#790
Merged
Travis: test against PHP 7.4, not 8.0 and fix PHPUnit failing#790
Conversation
PHPUnit 8 adds `void` return type declarations to the PHPUnit methods used by PHPCS, making it neigh impossible to make the unit test suite cross-version compatible for the PHP versions supported by PHPCompatibility. As of the recent update to the Travis images, the images for PHP 7.2+ now ship with PHPUnit 8 which causes the unit tests to fail. Officially, PHPUnit 7 is compatible with PHP 7.1, 7.2 and 7.3. Ref: https://phpunit.de/supported-versions.html So, for Travis images which come natively with PHPUnit 8 (PHP >= 7.2), PHPUnit 7 needs to be installed via Composer.
As PHP 7.3 has been released, the build to test code coverage should be run on PHP 7.3. This should raise the code coverage as for, for instance, the `FlexibleHeredocNowdoc` sniff, code coverage for a significant part of the sniff will only show up when run on PHP 7.3. In contrast to when the PHP 7.3 build was added, there does appear to be a code coverage driver available for PHP 7.3 by now, so we should be safe to make this change now. Ref: 764
Nightly has become PHP 8.0 since PHP 7.4 has been branched, so to continue to also test against PHP 7.4, it needs to be added separately. Refs: * https://twitter.com/nikita_ppv/status/1089839541828112384 * https://twitter.com/nikita_ppv/status/1094897743594770433
There is no PHPUnit version which is currently compatible with PHP 8. As that either means that the builds for nightly would always fail or - if the unit tests would be skipped -, the only check executed on nightly would be linting the files, I've elected to remove build testing against nightly for the time being. For more details about PHPUnit vs PHPCS vs PHP 8, see squizlabs/PHP_CodeSniffer 2416
wimg
approved these changes
Mar 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Travis: use PHPUnit 7.x for PHP >= 7.2
PHPUnit 8 adds
voidreturn type declarations to the PHPUnit methods used by PHPCS, making it neigh impossible to make the unit test suite cross-version compatible for the PHP versions supported by PHPCompatibility.As of the recent update to the Travis images, the images for PHP 7.2+ now ship with PHPUnit 8 which causes the unit tests to fail.
Officially, PHPUnit 7 is compatible with PHP 7.1, 7.2 and 7.3.
Ref: https://phpunit.de/supported-versions.html
So, for Travis images which come natively with PHPUnit 8 (PHP >= 7.2), PHPUnit 7 needs to be installed via Composer.
Travis: test code coverage on the highest supported PHP version
As PHP 7.3 has been released, the build to test code coverage should be run on PHP 7.3.
This should raise the code coverage as for, for instance, the
FlexibleHeredocNowdocsniff, code coverage for a significant part of the sniff will only show up when run on PHP 7.3.In contrast to when the PHP 7.3 build was added, there does appear to be a code coverage driver available for PHP 7.3 by now, so we should be safe to make this change now.
Ref: #764
Fixes #773
Travis: test builds against PHP 7.4
Nightly has become PHP 8.0 since PHP 7.4 has been branched, so to continue to also test against PHP 7.4, it needs to be added separately.
Refs:
Travis: remove testing against nightly / PHP 8
There is no PHPUnit version which is currently compatible with PHP 8.
As that either means that the builds for nightly would always fail or - if the unit tests would be skipped -, the only check executed on nightly would be linting the files, I've elected to remove build testing against nightly for the time being.
For more details about PHPUnit vs PHPCS vs PHP 8, see squizlabs/PHP_CodeSniffer#2416