Skip to content

Commit 4b4dfb4

Browse files
committed
update ugly hack for PHPUnit 8 support
1 parent a9e0125 commit 4b4dfb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ before_script:
5858
- composer self-update
5959
## Composer in PHP versions 5.x requires 3 GB memory
6060
- if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi
61+
## PHP 8 require PHPUnit 8 (ugly hack for support PHPUnit 7 and 8 together)
62+
- |
63+
if [[ ${TRAVIS_PHP_VERSION:0:2} == "8." ]] || [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
64+
travis_wait composer remove phpunit/phpunit --dev --no-update --no-interaction
65+
travis_wait composer require phpunit/phpunit ^8.0 --dev --no-update
66+
fi
67+
## Install composer packages
6168
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
6269
## PHP 8 require PHPUnit 8 (ugly hack for support PHPUnit 7 and 8 together)
6370
- |
6471
if [[ ${TRAVIS_PHP_VERSION:0:2} == "8." ]] || [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
65-
travis_wait composer remove phpunit/phpunit --dev --no-interaction --ignore-platform-reqs
66-
travis_wait composer require phpunit/phpunit ^8.0 --dev --ignore-platform-reqs
67-
6872
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUpBeforeClass()$/function setUpBeforeClass(): void/' {} \;
6973
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function tearDownAfterClass()$/function tearDownAfterClass(): void/' {} \;
7074
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUp()$/function setUp(): void/' {} \;

0 commit comments

Comments
 (0)