Skip to content

Commit 0f3237a

Browse files
committed
PHPCS 3.x: test against nightly
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.
1 parent a957a73 commit 0f3237a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.travis.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,26 @@ before_install:
4848
# Speed up build time by disabling Xdebug when its not needed.
4949
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
5050
# PHPUnit 8.x is not (yet) supported, so prevent issues with Travis images using it.
51-
- if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then composer install; fi
51+
- |
52+
if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then
53+
composer install
54+
elif [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION == "nightly" ]]; then
55+
// Allow installing "incompatible" PHPUnit version on PHP 8/nightly.
56+
composer install --ignore-platform-reqs
57+
fi
5258
5359
before_script:
5460
- if [[ $CUSTOM_INI == "1" && ${TRAVIS_PHP_VERSION:0:1} == "5" ]]; then phpenv config-add php5-testingConfig.ini; fi
5561
- if [[ $CUSTOM_INI == "1" ]] && [[ ${TRAVIS_PHP_VERSION:0:1} == "7" || $TRAVIS_PHP_VERSION == "nightly" ]]; then phpenv config-add php7-testingConfig.ini; fi
5662

5763
script:
5864
- php bin/phpcs --config-set php_path php
59-
- if [[ $PHPUNIT_INCOMPAT != "1" ]]; then phpunit tests/AllTests.php; fi
60-
# Don't run the unit tests on nightly (PHP 8.0) as there is no compatible PHPUnit version available yet.
61-
- if [[ $PHPUNIT_INCOMPAT == "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then vendor/bin/phpunit tests/AllTests.php; fi
65+
- |
66+
if [[ $PHPUNIT_INCOMPAT != "1" ]]; then
67+
phpunit tests/AllTests.php
68+
else
69+
vendor/bin/phpunit tests/AllTests.php
70+
fi
6271
- if [[ $CUSTOM_INI != "1" ]]; then php bin/phpcs --no-cache --parallel=1; fi
6372
- if [[ $CUSTOM_INI != "1" && $TRAVIS_PHP_VERSION != "nightly" ]]; then pear package-validate package.xml; fi
6473
- if [[ $PEAR_VALIDATE == "1" ]]; then php scripts/validate-pear-package.php; fi

0 commit comments

Comments
 (0)