Property | Type | Description | |
---|---|---|---|
$_core_actions_get | type | List of ajax actions called via POST | |
$_core_actions_post | type | List of ajax actions called via GET | |
$_error_level | integer | Saved error reporting level | |
$_last_response | type | Last AJAX response. This is set via echo -or- wp_die. |
Method | Description | |
---|---|---|
dieHandler ( string $message ) | Handler for wp_die() Save the output for analysis, stop execution by throwing an exception. | |
getDieHandler ( ) : callback | Return our callback handler | |
logout ( ) | Clear login cookies, unset the current user | |
setUp ( ) | Set up the test fixture. | |
setUpBeforeClass ( ) | ||
tearDown ( ) | Tear down the test fixture. |
Method | Description | |
---|---|---|
_handleAjax ( string $action ) | Mimic the ajax handling of admin-ajax.php Capture the output via output buffering, and if there is any, store it in $this->_last_message. | |
_setRole ( string $role ) | Switch between user roles E.g. administrator, editor, author, contributor, subscriber |
protected _handleAjax ( string $action ) | ||
$action | string |
WPAjaxDieStopException( $message )
You can test for this with:
$this->setExpectedException( 'WPAjaxDieStopException', 'something contained in $message' );
Normal program termination (wp_die called at then end of output) will throw WPAjaxDieContinueException( $message )
You can test for this with:
$this->setExpectedException( 'WPAjaxDieContinueException', 'something contained in $message' );
public dieHandler ( string $message ) | ||
$message | string |
public getDieHandler ( ) : callback | ||
return | callback |
public setUp ( ) |
public tearDown ( ) |
protected static type $_core_actions_get | ||
return | type |
protected static type $_core_actions_post | ||
return | type |
protected int $_error_level | ||
return | integer |