diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3d940a..0e13e6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,17 +7,18 @@ on: jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: php: - 8.2 - 8.1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug + ini-file: development - run: composer install - run: vendor/bin/phpunit --coverage-text diff --git a/composer.json b/composer.json index 8bdcd35..2d1ad50 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "react/promise": "^3.0 || ^2.8 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f4b5805..63ec536 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,11 @@ - + convertDeprecationsToExceptions="true"> ./tests/ @@ -15,4 +16,12 @@ ./src/ + + + + + + + + diff --git a/tests/TestCase.php b/tests/TestCase.php index ee0f476..904c63b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,6 @@ namespace React\Tests\Async; -use PHPUnit\Framework\MockObject\MockBuilder; use PHPUnit\Framework\TestCase as BaseTestCase; class TestCase extends BaseTestCase @@ -40,12 +39,6 @@ protected function expectCallableNever() protected function createCallableMock() { - if (method_exists(MockBuilder::class, 'addMethods')) { - // PHPUnit 9+ - return $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock(); - } else { - // PHPUnit < 9 - return $this->getMockBuilder(\stdClass::class)->setMethods(['__invoke'])->getMock(); - } + return $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock(); } }