Make WordPress Core


Ignore:
Timestamp:
04/12/2017 02:58:33 PM (7 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php

    r39189 r40417  
    2121    function test_invalid_username_password() {
    2222        $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'username', 'password' ) );
    23         $this->assertInstanceOf( 'IXR_Error', $result );
     23        $this->assertIXRError( $result );
    2424        $this->assertEquals( 403, $result->code );
    2525    }
     
    3232
    3333        $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
    34         $this->assertInstanceOf( 'IXR_Error', $result );
     34        $this->assertIXRError( $result );
    3535        $this->assertEquals( 404, $result->code );
    3636    }
     
    4040
    4141        $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
    42         $this->assertNotInstanceOf( 'IXR_Error', $result );
     42        $this->assertNotIXRError( $result );
    4343
    4444        // Check data types
     
    8181
    8282        $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
    83         $this->assertNotInstanceOf( 'IXR_Error', $result );
     83        $this->assertNotIXRError( $result );
    8484
    8585        $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
Note: See TracChangeset for help on using the changeset viewer.