Skip to content

Commit 9ae3696

Browse files
committed
Travis: Use PHPUnit 7 with PHP 8
By default, tests on PHP 8 use PHPUnit 5.2.7, which includes calls to `each()`, which was removed in PHP 8, and therefore fails. By ignoring the platform requirements, then PHPUnit 7 should be installed.
1 parent 27e9363 commit 9ae3696

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
php: 7.3
6363
env: PHPCS_BRANCH="dev-master"
6464
before_install: phpenv config-rm xdebug.ini || echo 'No xdebug config.'
65-
install: composer install --dev --no-suggest
65+
install: composer install --no-suggest
6666
script:
6767
# Run PHPCS against VIPCS.
6868
- ./bin/phpcs
@@ -82,11 +82,14 @@ before_install:
8282
fi
8383
8484
install:
85-
- composer require squizlabs/php_codesniffer:"$PHPCS_BRANCH" --update-no-dev --no-suggest --no-scripts
85+
- composer require squizlabs/php_codesniffer:"$PHPCS_BRANCH" --no-update --no-suggest --no-scripts
8686
- |
87-
# Don't need dev dependencies for running `php -l`.
88-
if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Lint" ]]; then
89-
composer install --dev --no-suggest
87+
if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
88+
# PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform
89+
# requirements to get PHPUnit 7.x to install on nightly.
90+
composer install --ignore-platform-reqs --no-suggest
91+
else
92+
composer install --no-suggest
9093
fi
9194
9295
script:

0 commit comments

Comments
 (0)