Skip to content

Commit cf02aeb

Browse files
authored
Merge pull request #22 from clue-labs/phpunit8
Update test environment to fix tests on legacy PHP 7.2 with PHPUnit 8.5
2 parents f2b7179 + 58063f4 commit cf02aeb

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ jobs:
3131
php-version: ${{ matrix.php }}
3232
coverage: xdebug
3333
- run: composer install
34-
- run: vendor/bin/phpunit --coverage-text
35-
if: ${{ matrix.php >= 7.3 }}
36-
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
37-
if: ${{ matrix.php < 7.3 }}
34+
- run: vendor/bin/phpunit --coverage-text ${{ matrix.php < 7.3 && '-c phpunit.xml.legacy' || '' }}
3835

3936
PHPUnit-hhvm:
4037
name: PHPUnit (HHVM)

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
"react/promise": "^2.0 || ^1.0"
2828
},
2929
"require-dev": {
30-
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
30+
"phpunit/phpunit": "^9.6 || ^8.5 || ^5.7 || ^4.8.36"
3131
}
3232
}

‎tests/TestCase.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ protected function expectCallableNever()
2828
protected function createCallableMock()
2929
{
3030
if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) {
31-
// PHPUnit 9+
31+
// PHPUnit 8.5+
3232
return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock();
3333
} else {
34-
// legacy PHPUnit 4 - PHPUnit 8
34+
// legacy PHPUnit 4 - PHPUnit 8.4
3535
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
3636
}
3737
}

0 commit comments

Comments
 (0)