Build/Test tools: Add support for passing a WP_Error
object to wp_die()
during tests.
This brings the functionality inline with `wp_die()` during non-test usage. Fixes #46460 git-svn-id: https://develop.svn.wordpress.org/trunk@44944 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
34251aa2ab
commit
4b2a7d4ab6
@ -424,6 +424,10 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Framework_TestCase {
|
||||
* @param string $message The `wp_die()` message.
|
||||
*/
|
||||
public function wp_die_handler( $message ) {
|
||||
if ( is_wp_error( $message ) ) {
|
||||
$message = $message->get_error_message();
|
||||
}
|
||||
|
||||
if ( ! is_scalar( $message ) ) {
|
||||
$message = '0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user