diff --git a/tests/phpunit/includes/testcase-ajax.php b/tests/phpunit/includes/testcase-ajax.php index 5be85dc160..d9f44d9590 100644 --- a/tests/phpunit/includes/testcase-ajax.php +++ b/tests/phpunit/includes/testcase-ajax.php @@ -196,15 +196,18 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase { * * Save the output for analysis, stop execution by throwing an exception. * - * Error conditions (no output, just die) will throw WPAjaxDieStopException( $message ) + * Error conditions (no output, just die) will throw WPAjaxDieStopException( $message ). * You can test for this with: * - * $this->setExpectedException( 'WPAjaxDieStopException', 'something contained in $message' ); + * $this->expectException( 'WPAjaxDieStopException' ); + * $this->expectExceptionMessage( 'something contained in $message' ); * - * Normal program termination (wp_die called at then end of output) will throw WPAjaxDieContinueException( $message ) + * + * Normal program termination (wp_die called at the end of output) will throw WPAjaxDieContinueException( $message ). * You can test for this with: * - * $this->setExpectedException( 'WPAjaxDieContinueException', 'something contained in $message' ); + * $this->expectException( 'WPAjaxDieContinueException' ); + * $this->expectExceptionMessage( 'something contained in $message' ); * * * @param string $message The message to set.