Skip to content

Commit e41ea6a

Browse files
authored
Merge pull request #1643 from WordPress-Coding-Standards/feature/travis-test-against-php-7.4
Travis: test builds against PHP 7.4 & work around for PHPUnit 8
2 parents 12c5647 + 4426a06 commit e41ea6a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ php:
2121
- 7.1
2222
- 7.2
2323
- 7.3
24-
- nightly
24+
- "7.4snapshot"
2525

2626
env:
2727
# `master` is now 3.x.
@@ -42,7 +42,7 @@ matrix:
4242

4343
allow_failures:
4444
# Allow failures for unstable builds.
45-
- php: nightly
45+
- php: "7.4snapshot"
4646

4747
before_install:
4848
# Speed up build time by disabling Xdebug.
@@ -60,12 +60,20 @@ before_install:
6060
# The above require already does the install.
6161
$(pwd)/vendor/bin/phpcs --config-set installed_paths $(pwd)
6262
fi
63+
# Download PHPUnit 7.x for builds on PHP >= 7.2 as the PHPCS
64+
# test suite is currently not compatible with PHPUnit 8.x.
65+
- if [[ ${TRAVIS_PHP_VERSION:0:3} > "7.1" ]]; then wget -P $PHPUNIT_DIR https://phar.phpunit.de/phpunit-7.phar && chmod +x $PHPUNIT_DIR/phpunit-7.phar; fi
6366

6467
script:
6568
# Lint the PHP files against parse errors.
6669
- if [[ "$LINT" == "1" ]]; then if find . -path ./vendor -prune -o -path ./bin -prune -o -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
6770
# Run the unit tests.
68-
- phpunit --filter WordPress --bootstrap="$(pwd)/vendor/squizlabs/php_codesniffer/tests/bootstrap.php" $(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php
71+
- |
72+
if [[ ${TRAVIS_PHP_VERSION:0:3} > "7.1" ]]; then
73+
php $PHPUNIT_DIR/phpunit-7.phar --filter WordPress --bootstrap="$(pwd)/vendor/squizlabs/php_codesniffer/tests/bootstrap.php" $(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php
74+
else
75+
phpunit --filter WordPress --bootstrap="$(pwd)/vendor/squizlabs/php_codesniffer/tests/bootstrap.php" $(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php
76+
fi
6977
# Test for fixer conflicts by running the auto-fixers of the complete WPCS over the test case files.
7078
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
7179
# For the first run, the exit code will be 1 (= all fixable errors fixed).

0 commit comments

Comments
 (0)