Skip to content

Run tests on PHP 8.4 and update test environment #268

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

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

PaulRotmann
Copy link

Builds on top of #267, #261, #255 and others.

⚠️ This PR can only be merged after PR #267 has been merged, as it requires the PHP 8.4 compatibility fixes and dependency updates to pass successfully.

Also this PR resolves #266.

Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulRotmann Thanks for looking into this, changes look reasonable 👍

However, besides the PHPstan update discussed in #267, the test suite currently reports one error on PHP 8.4+ only:

There was 1 failure:

1) /home/runner/work/promise/promise/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
-Fatal error: Unexpected RuntimeException: foo in %s line %d
+Deprecated: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead in /home/runner/work/promise/promise/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.php on line 9
+
+Fatal error: Unexpected RuntimeException: foo in /home/runner/work/promise/promise/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.php on line 9

/home/runner/work/promise/promise/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt:24

Here's some background info:

Calling trigger_error() with error_level being equal to E_USER_ERROR is now deprecated.

https://www.php.net/manual/en/migration84.deprecated.php

This only affects a single test that specifically tests how the rejection logic behaves when a custom function using this (deprecated) functionality is used. Accordingly, we should probably skip the affected test on PHP 8.4+ (originally introduced in #249):

trigger_error('Unexpected ' . get_class($e) . ': ' .$e->getMessage(), E_USER_ERROR);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants