Skip to content

Travis: test against PHP 7.4, not 8.0 and fix PHPUnit failing#790

Merged
wimg merged 4 commits intomasterfrom
feature/travis-tweaks
Mar 10, 2019
Merged

Travis: test against PHP 7.4, not 8.0 and fix PHPUnit failing#790
wimg merged 4 commits intomasterfrom
feature/travis-tweaks

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 11, 2019

Travis: use PHPUnit 7.x for PHP >= 7.2

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.

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 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

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

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 wimg merged commit c175811 into master Mar 10, 2019
@jrfnl jrfnl deleted the feature/travis-tweaks branch March 11, 2019 01:03
@jrfnl jrfnl removed the PR: quick merge PR only contains relatively simple changes label Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants