Brain-WP / BrainMonkey

Mocking utility for PHP functions and WordPress plugin API
https://giuseppe-mazzapica.gitbook.io/brain-monkey/
MIT License
304 stars 29 forks source link

PHP 8.4 | Fix passing `E_USER_ERROR` to `trigger_error()` #149

Closed jrfnl closed 3 months ago

jrfnl commented 3 months ago

PHP 8.4 deprecates passing E_USER_ERROR to trigger_error(), with the recommendation being to replace these type of calls with either an Exception or an exit statement.

This commit fixes the one instance found in this codebase by introducing a new MissingFunctionExpectations exception.

Includes updating the related tests (and test names) to match.

Ref: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error

Related to #146

gmazzap commented 3 months ago

Thank you very much @jrfnl

Awesome work as usual :)