mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Docs: Update the code example in WP_Ajax_UnitTestCase::dieHandler() DocBlock to use expectException().
Follow-up to [48996], [48997]. See #51344. git-svn-id: https://develop.svn.wordpress.org/trunk@48998 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 <code>WPAjaxDieStopException( $message )</code>
|
||||
* Error conditions (no output, just die) will throw <code>WPAjaxDieStopException( $message )</code>.
|
||||
* You can test for this with:
|
||||
* <code>
|
||||
* $this->setExpectedException( 'WPAjaxDieStopException', 'something contained in $message' );
|
||||
* $this->expectException( 'WPAjaxDieStopException' );
|
||||
* $this->expectExceptionMessage( 'something contained in $message' );
|
||||
* </code>
|
||||
* Normal program termination (wp_die called at then end of output) will throw <code>WPAjaxDieContinueException( $message )</code>
|
||||
*
|
||||
* Normal program termination (wp_die called at the end of output) will throw <code>WPAjaxDieContinueException( $message )</code>.
|
||||
* You can test for this with:
|
||||
* <code>
|
||||
* $this->setExpectedException( 'WPAjaxDieContinueException', 'something contained in $message' );
|
||||
* $this->expectException( 'WPAjaxDieContinueException' );
|
||||
* $this->expectExceptionMessage( 'something contained in $message' );
|
||||
* </code>
|
||||
*
|
||||
* @param string $message The message to set.
|
||||
|
||||
Reference in New Issue
Block a user