mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Build/Test tools: Introduce and implement assertNotIXRError() and assertIXRError() assertion methods.
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message. Fixes #40423 git-svn-id: https://develop.svn.wordpress.org/trunk@40417 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -438,6 +438,17 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
$this->assertNotInstanceOf( 'WP_Error', $actual, $message );
|
||||
}
|
||||
|
||||
function assertIXRError( $actual, $message = '' ) {
|
||||
$this->assertInstanceOf( 'IXR_Error', $actual, $message );
|
||||
}
|
||||
|
||||
function assertNotIXRError( $actual, $message = '' ) {
|
||||
if ( $actual instanceof IXR_Error && '' === $message ) {
|
||||
$message = $actual->message;
|
||||
}
|
||||
$this->assertNotInstanceOf( 'IXR_Error', $actual, $message );
|
||||
}
|
||||
|
||||
function assertEqualFields( $object, $fields ) {
|
||||
foreach( $fields as $field_name => $field_value ) {
|
||||
if ( $object->$field_name != $field_value ) {
|
||||
|
||||
Reference in New Issue
Block a user