mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Previously, in case of failure, `WP_UnitTestCase_Base::assertNotWPError()` displayed the actual error message from the passed `WP_Error` object, but only if the `$message` parameter was empty. This made the assertion less helpful, as the actual error message was lost in case there was a non-empty `$message` parameter passed to the method, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines: > All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method. This commit ensures that the actual error message is always displayed, in addition to the passed `$message` parameter. The same applies to `WP_UnitTestCase_Base::assertNotIXRError()`. Follow-up to [34638], [40417]. Props jrf, SergeyBiryukov. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53536 602fd350-edb4-49c9-b593-d223f7449a82 |
||
|---|---|---|
| .. | ||
| e2e | ||
| gutenberg | ||
| phpunit | ||
| qunit | ||
| visual-regression | ||