Passing WP_Error instance to wp_die when unit testing doesn't work
-
I’m testing some code using PHPUnit, and when my code uses
wp_die(new WP_Error('errorCode', 'errorMessage'));
I get the error:
Error: Wrong parameters for WPDieException([string $message [, long $code [, Throwable $previous = NULL]]])
If I change my code to:
wp_die('errorMessage');
Then it works correctly (I getWPDieException: errorMessage
).
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Passing WP_Error instance to wp_die when unit testing doesn't work’ is closed to new replies.