Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test suite to avoid deprecation notices for PHP 8.1+ #230

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
colors="true"
cacheResult="false">
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="Promise Test Suite">
<directory>./tests/</directory>
Expand All @@ -19,4 +20,7 @@
<file>./src/functions_include.php</file>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1" />
</php>
</phpunit>
6 changes: 3 additions & 3 deletions tests/Internal/RejectedPromiseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public function getPromiseTestAdapter(callable $canceller = null)
'resolve' => function () {
throw new LogicException('You cannot call resolve() for React\Promise\RejectedPromise');
},
'reject' => function ($reason = null) use (&$promise) {
'reject' => function (\Throwable $reason) use (&$promise) {
if (!$promise) {
$promise = new RejectedPromise($reason);
}
},
'settle' => function ($reason = "") use (&$promise) {
'settle' => function ($reason = '') use (&$promise) {
if (!$promise) {
if (!$reason instanceof Exception) {
$reason = new Exception($reason);
$reason = new Exception((string) $reason);
}

$promise = new RejectedPromise($reason);
Expand Down