From daf619f5885c6d761f0cea52092725eaef4fc1fa Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 25 Jan 2021 14:24:28 +0100 Subject: [PATCH 1/2] Replace deprecated at() Mocks --- tests/React/Promise/DeferredProgressTest.php | 24 +++++++------------- 1 file changed, 8 insertions(+), 16 deletions(-) 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() From c28e65abf690b0184caf961ad0fc900861465d7e Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 25 Jan 2021 14:28:48 +0100 Subject: [PATCH 2/2] Update PHPUnit configuration schema for PHPUnit 9.3 --- .gitattributes | 1 + .travis.yml | 3 ++- composer.json | 2 +- phpunit.xml.dist | 16 ++++++++++------ phpunit.xml.legacy | 18 ++++++++++++++++++ 5 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 phpunit.xml.legacy 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/ + + +