diff --git a/.gitattributes b/.gitattributes index 982c460d..e9da46b9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,5 @@ /.gitignore export-ignore /.travis.yml export-ignore /phpunit.xml.dist export-ignore +/phpunit.xml.legacy export-ignore /tests export-ignore diff --git a/.travis.yml b/.travis.yml index db571d1c..a22e64cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,8 @@ install: - composer install script: - - ./vendor/bin/phpunit -v --coverage-text --coverage-clover=./build/logs/clover.xml + - if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=./build/logs/clover.xml; fi + - if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy --coverage-clover=./build/logs/clover.xml; fi after_script: - if [ -f ./build/logs/clover.xml ]; then travis_retry composer require satooshi/php-coveralls --no-interaction --update-with-dependencies; fi diff --git a/composer.json b/composer.json index 0c01d6cf..b991a256 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0b97c746..3ccce487 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,18 +1,22 @@ - + + ./tests/ - - - + + ./src/ ./src/functions_include.php - - + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy new file mode 100644 index 00000000..84ac9123 --- /dev/null +++ b/phpunit.xml.legacy @@ -0,0 +1,21 @@ + + + + + + + ./tests/ + + + + + ./src/ + + ./src/functions_include.php + + + + diff --git a/tests/PromiseTest/NotifyTestTrait.php b/tests/PromiseTest/NotifyTestTrait.php index 4501df67..5b740652 100644 --- a/tests/PromiseTest/NotifyTestTrait.php +++ b/tests/PromiseTest/NotifyTestTrait.php @@ -235,14 +235,10 @@ public function notifyShouldAllowResolveAfterProgress() $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); - $mock - ->expects($this->at(0)) - ->method('__invoke') - ->with($this->identicalTo(1)); - $mock - ->expects($this->at(1)) - ->method('__invoke') - ->with($this->identicalTo(2)); + $mock->expects($this->exactly(2))->method('__invoke')->withConsecutive( + array($this->identicalTo(1)), + array($this->identicalTo(2)) + ); $adapter->promise() ->then( @@ -261,14 +257,10 @@ public function notifyShouldAllowRejectAfterProgress() $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); - $mock - ->expects($this->at(0)) - ->method('__invoke') - ->with($this->identicalTo(1)); - $mock - ->expects($this->at(1)) - ->method('__invoke') - ->with($this->identicalTo(2)); + $mock->expects($this->exactly(2))->method('__invoke')->withConsecutive( + array($this->identicalTo(1)), + array($this->identicalTo(2)) + ); $adapter->promise() ->then(