Skip to content

Commit f737259

Browse files
committed
Update test suite and report failed assertions
1 parent efd2863 commit f737259

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
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"
66
colors="true"
7-
cacheResult="false">
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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ protected function expectCallableNever()
4040

4141
protected function createCallableMock()
4242
{
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-
}
43+
return $this->getMockBuilder(\stdClass::class)->addMethods(['__invoke'])->getMock();
5044
}
5145
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy