Skip to content

Commit

Permalink
Merge pull request #66 from clue-labs/update-tests
Browse files Browse the repository at this point in the history
[4.x] Update test suite and report failed assertions
  • Loading branch information
WyriHaximus committed Oct 29, 2022
2 parents efd2863 + 61baa83 commit 34c49a1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
15 changes: 12 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
colors="true"
cacheResult="false">
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="React Test Suite">
<directory>./tests/</directory>
Expand All @@ -15,4 +16,12 @@
<directory>./src/</directory>
</include>
</coverage>
<php>
<ini name="error_reporting" value="-1" />
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
<!-- <ini name="zend.assertions=1" value="1" /> -->
<ini name="assert.active" value="1" />
<ini name="assert.exception" value="1" />
<ini name="assert.bail" value="0" />
</php>
</phpunit>
9 changes: 1 addition & 8 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace React\Tests\Async;

use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
Expand Down Expand Up @@ -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();
}
}

0 comments on commit 34c49a1

Please sign in to comment.