diff --git a/.gitattributes b/.gitattributes index 0925d33a..eccc7632 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,4 +3,5 @@ /.travis.yml export-ignore /examples/ export-ignore /phpunit.xml.dist export-ignore +/phpunit.xml.legacy export-ignore /tests/ export-ignore diff --git a/.travis.yml b/.travis.yml index e1421bc6..56233305 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,4 +23,5 @@ install: - composer install script: - - vendor/bin/phpunit --coverage-text + - if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text; fi + - if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy; fi diff --git a/composer.json b/composer.json index 2e1f1cd8..8ccff78b 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8ce12cfa..0f10e1f4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,15 +1,19 @@ - + + ./tests/React/Promise/ - - - + + ./src/ - - + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy new file mode 100644 index 00000000..73f4b71f --- /dev/null +++ b/phpunit.xml.legacy @@ -0,0 +1,18 @@ + + + + + + + ./tests/React/Promise/ + + + + + ./src/ + + + diff --git a/tests/React/Promise/DeferredProgressTest.php b/tests/React/Promise/DeferredProgressTest.php index 44875781..2594adc2 100644 --- a/tests/React/Promise/DeferredProgressTest.php +++ b/tests/React/Promise/DeferredProgressTest.php @@ -259,14 +259,10 @@ public function shouldAllowResolveAfterProgress() $d = new Deferred(); $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)) + ); $d ->promise() @@ -290,14 +286,10 @@ public function shouldAllowRejectAfterProgress() $d = new Deferred(); $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)) + ); $d ->promise()