Skip to content

Commit 1c325e7

Browse files
authored
Merge pull request #230 from clue-labs/php8.1-tests
Update test suite to avoid deprecation notices for PHP 8.1+
2 parents e63bcec + ed5bd52 commit 1c325e7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

phpunit.xml.dist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/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,7 @@
1920
<file>./src/functions_include.php</file>
2021
</exclude>
2122
</coverage>
23+
<php>
24+
<ini name="error_reporting" value="-1" />
25+
</php>
2226
</phpunit>

tests/Internal/RejectedPromiseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public function getPromiseTestAdapter(callable $canceller = null)
2929
'resolve' => function () {
3030
throw new LogicException('You cannot call resolve() for React\Promise\RejectedPromise');
3131
},
32-
'reject' => function ($reason = null) use (&$promise) {
32+
'reject' => function (\Throwable $reason) use (&$promise) {
3333
if (!$promise) {
3434
$promise = new RejectedPromise($reason);
3535
}
3636
},
37-
'settle' => function ($reason = "") use (&$promise) {
37+
'settle' => function ($reason = '') use (&$promise) {
3838
if (!$promise) {
3939
if (!$reason instanceof Exception) {
40-
$reason = new Exception($reason);
40+
$reason = new Exception((string) $reason);
4141
}
4242

4343
$promise = new RejectedPromise($reason);

0 commit comments

Comments
 (0)