Skip to content

Commit

Permalink
PHPCS 3.x: test against nightly
Browse files Browse the repository at this point in the history
PR 2958 turned running the unit tests on for the PHPCS 4.x branch, but this wasn't done for the PHPCS 3.x branch yet.

This commit basically does the same for PHPCS 3.x. PHPUnit 7 will run on PHP 8, even though unsupported, so ignoring platform requirements when installing via Composer allows for the tests for PHPCS 3.x to run on PHP 8.
  • Loading branch information
jrfnl committed Jul 12, 2020
1 parent a957a73 commit 0f3237a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,26 @@ before_install:
# Speed up build time by disabling Xdebug when its not needed.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# PHPUnit 8.x is not (yet) supported, so prevent issues with Travis images using it.
- if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then composer install; fi
- |
if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then
composer install
elif [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION == "nightly" ]]; then
// Allow installing "incompatible" PHPUnit version on PHP 8/nightly.
composer install --ignore-platform-reqs
fi
before_script:
- if [[ $CUSTOM_INI == "1" && ${TRAVIS_PHP_VERSION:0:1} == "5" ]]; then phpenv config-add php5-testingConfig.ini; fi
- if [[ $CUSTOM_INI == "1" ]] && [[ ${TRAVIS_PHP_VERSION:0:1} == "7" || $TRAVIS_PHP_VERSION == "nightly" ]]; then phpenv config-add php7-testingConfig.ini; fi

script:
- php bin/phpcs --config-set php_path php
- if [[ $PHPUNIT_INCOMPAT != "1" ]]; then phpunit tests/AllTests.php; fi
# Don't run the unit tests on nightly (PHP 8.0) as there is no compatible PHPUnit version available yet.
- if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then vendor/bin/phpunit tests/AllTests.php; fi
- |
if [[ $PHPUNIT_INCOMPAT != "1" ]]; then
phpunit tests/AllTests.php
else
vendor/bin/phpunit tests/AllTests.php
fi
- if [[ $CUSTOM_INI != "1" ]]; then php bin/phpcs --no-cache --parallel=1; fi
- if [[ $CUSTOM_INI != "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then pear package-validate package.xml; fi
- if [[ $PEAR_VALIDATE == "1" ]]; then php scripts/validate-pear-package.php; fi
Expand Down

0 comments on commit 0f3237a

Please sign in to comment.