Skip to content

Commit 34c49a1

Browse files
authored
Merge pull request #66 from clue-labs/update-tests
[4.x] Update test suite and report failed assertions
2 parents efd2863 + 61baa83 commit 34c49a1

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
1313
php:
1414
- 8.2
1515
- 8.1
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- uses: shivammathur/setup-php@v2
1919
with:
2020
php-version: ${{ matrix.php }}
2121
coverage: xdebug
22+
ini-file: development
2223
- run: composer install
2324
- run: vendor/bin/phpunit --coverage-text

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"react/promise": "^3.0 || ^2.8 || ^1.2.1"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^9.3"
34+
"phpunit/phpunit": "^9.5"
3535
},
3636
"autoload": {
3737
"psr-4": {

phpunit.xml.dist

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
55
bootstrap="vendor/autoload.php"
6+
cacheResult="false"
67
colors="true"
7-
cacheResult="false">
8+
convertDeprecationsToExceptions="true">
89
<testsuites>
910
<testsuite name="React Test Suite">
1011
<directory>./tests/</directory>
@@ -15,4 +16,12 @@
1516
<directory>./src/</directory>
1617
</include>
1718
</coverage>
19+
<php>
20+
<ini name="error_reporting" value="-1" />
21+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
22+
<!-- <ini name="zend.assertions=1" value="1" /> -->
23+
<ini name="assert.active" value="1" />
24+
<ini name="assert.exception" value="1" />
25+
<ini name="assert.bail" value="0" />
26+
</php>
1827
</phpunit>

tests/TestCase.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace React\Tests\Async;
44

5-
use PHPUnit\Framework\MockObject\MockBuilder;
65
use PHPUnit\Framework\TestCase as BaseTestCase;
76

87
class TestCase extends BaseTestCase
@@ -40,12 +39,6 @@ protected function expectCallableNever()
4039

4140
protected function createCallableMock()
4241
{
43-
if (method_exists(MockBuilder::class, 'addMethods')) {
44-
// PHPUnit 9+
45-
return $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock();
46-
} else {
47-
// PHPUnit < 9
48-
return $this->getMockBuilder(\stdClass::class)->setMethods(['__invoke'])->getMock();
49-
}
42+
return $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock();
5043
}
5144
}

0 commit comments

Comments
 (0)