wordpress-develop/tests
Sergey Biryukov 397b4e45f2 Tests: Always include the error message in assertNotWPError() and assertNotIXRError().
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
2022-06-20 17:27:15 +00:00
..
e2e Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00
gutenberg Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests. 2021-06-01 09:21:36 +00:00
phpunit Tests: Always include the error message in assertNotWPError() and assertNotIXRError(). 2022-06-20 17:27:15 +00:00
qunit REST API: Fixes /wp/v2/pattern-directory/patterns endpoint response for slug parameter. 2022-05-02 13:58:48 +00:00
visual-regression Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00