travis php 8 - convert tests from phpunit 7 format to phpunit 8 format
This commit is contained in:
parent
4cc2cc1aeb
commit
6b99923363
14
.travis.yml
14
.travis.yml
|
|
@ -59,11 +59,23 @@ before_script:
|
||||||
## Composer in PHP versions 5.x requires 3 GB memory
|
## Composer in PHP versions 5.x requires 3 GB memory
|
||||||
- if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi
|
- if [ ${TRAVIS_PHP_VERSION:0:2} == "5." ]; then export COMPOSER_MEMORY_LIMIT=3G ; fi
|
||||||
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
|
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
|
||||||
## PHP 8 require PHPUnit 8
|
## PHP 8 require PHPUnit 8 (ugly hack for support PHPUnit 7 and 8 together)
|
||||||
- |
|
- |
|
||||||
if [[ ${TRAVIS_PHP_VERSION:0:2} == "8." ]] || [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
|
if [[ ${TRAVIS_PHP_VERSION:0:2} == "8." ]] || [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
|
||||||
travis_wait composer remove phpunit/phpunit --dev --no-interaction --ignore-platform-reqs
|
travis_wait composer remove phpunit/phpunit --dev --no-interaction --ignore-platform-reqs
|
||||||
travis_wait composer require phpunit/phpunit ^8.0 --dev --ignore-platform-reqs
|
travis_wait composer require phpunit/phpunit ^8.0 --dev --ignore-platform-reqs
|
||||||
|
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUpBeforeClass()$/function setUpBeforeClass(): void/' {} \;
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function tearDownAfterClass()$/function tearDownAfterClass(): void/' {} \;
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function setUp()$/function setUp(): void/' {} \;
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/function tearDown()$/function tearDown(): void/' {} \;
|
||||||
|
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/->assertContains(/->assertStringContainsString(/' {} \;
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e 's/->assertNotContains(/->assertStringNotContainsString(/' {} \;
|
||||||
|
find ./tests/ -name "*.php" -type f -exec sed -i -e "s/->assertInternalType('array', /->assertIsArray(/" {} \;
|
||||||
|
|
||||||
|
sed -i "s/\$this->addWarning('The @expectedException,/\/\/\$this->addWarning('The @expectedException,/" ./vendor/phpunit/phpunit/src/Framework/TestCase.php
|
||||||
|
sed -i "s/self::createWarning('The optional \$delta/\/\/self::createWarning('The optional \$delta/" ./vendor/phpunit/phpunit/src/Framework/Assert.php
|
||||||
fi
|
fi
|
||||||
## PHPDocumentor
|
## PHPDocumentor
|
||||||
##- mkdir -p build/docs
|
##- mkdir -p build/docs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue