Skip to content

Commit d47bd60

Browse files
authored
Merge pull request #241 from clue-labs/2-update-tests
[2.x] Update test suite and report failed assertions
2 parents f23788b + 41c9b46 commit d47bd60

File tree

6 files changed

+38
-15
lines changed

6 files changed

+38
-15
lines changed

.github/workflows/ci.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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:
@@ -23,11 +23,12 @@ jobs:
2323
- 5.5
2424
- 5.4
2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2727
- uses: shivammathur/setup-php@v2
2828
with:
2929
php-version: ${{ matrix.php }}
3030
coverage: xdebug
31+
ini-file: development
3132
- run: composer install
3233
- run: vendor/bin/phpunit --coverage-text
3334
if: ${{ matrix.php >= 7.3 }}
@@ -36,13 +37,16 @@ jobs:
3637

3738
PHPUnit-hhvm:
3839
name: PHPUnit (HHVM)
39-
runs-on: ubuntu-18.04
40+
runs-on: ubuntu-22.04
4041
continue-on-error: true
4142
steps:
42-
- uses: actions/checkout@v2
43-
- uses: azjezz/setup-hhvm@v1
43+
- uses: actions/checkout@v3
44+
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
45+
- name: Run hhvm composer.phar install
46+
uses: docker://hhvm/hhvm:3.30-lts-latest
4447
with:
45-
version: lts-3.30
46-
- run: composer self-update --2.2 # downgrade Composer for HHVM
47-
- run: hhvm $(which composer) install
48-
- run: hhvm vendor/bin/phpunit
48+
args: hhvm composer.phar install
49+
- name: Run hhvm vendor/bin/phpunit
50+
uses: docker://hhvm/hhvm:3.30-lts-latest
51+
with:
52+
args: hhvm vendor/bin/phpunit

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php": ">=5.4.0"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
31+
"phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
3232
},
3333
"autoload": {
3434
"psr-4": {

phpunit.xml.dist

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.5+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7+
cacheResult="false"
78
colors="true"
8-
cacheResult="false">
9+
convertDeprecationsToExceptions="true">
910
<testsuites>
1011
<testsuite name="Promise Test Suite">
1112
<directory>./tests/</directory>
@@ -19,4 +20,12 @@
1920
<file>./src/functions_include.php</file>
2021
</exclude>
2122
</coverage>
23+
<php>
24+
<ini name="error_reporting" value="-1" />
25+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
26+
<!-- <ini name="zend.assertions=1" value="1" /> -->
27+
<ini name="assert.active" value="1" />
28+
<ini name="assert.exception" value="1" />
29+
<ini name="assert.bail" value="0" />
30+
</php>
2231
</phpunit>

phpunit.xml.legacy

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
3+
<!-- PHPUnit configuration file with old format before PHPUnit 9 -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
@@ -18,4 +18,12 @@
1818
</exclude>
1919
</whitelist>
2020
</filter>
21+
<php>
22+
<ini name="error_reporting" value="-1" />
23+
<!-- Evaluate assertions, requires running with "php -d zend.assertions=1 vendor/bin/phpunit" -->
24+
<!-- <ini name="zend.assertions=1" value="1" /> -->
25+
<ini name="assert.active" value="1" />
26+
<ini name="assert.exception" value="1" />
27+
<ini name="assert.bail" value="0" />
28+
</php>
2129
</phpunit>

tests/fixtures/CountableException.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
class CountableException extends RuntimeException implements Countable
99
{
10+
#[\ReturnTypeWillChange]
1011
public function count()
1112
{
1213
return 0;

tests/fixtures/CountableNonException.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
class CountableNonException implements Countable
99
{
10+
#[\ReturnTypeWillChange]
1011
public function count()
1112
{
1213
return 0;

0 commit comments

Comments
 (0)