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/getPages.php

    r39189 r40417  
    2727    function test_invalid_username_password() {
    2828        $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
    29         $this->assertInstanceOf( 'IXR_Error', $result );
     29        $this->assertIXRError( $result );
    3030        $this->assertEquals( 403, $result->code );
    3131    }
     
    3535
    3636        $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'contributor', 'contributor' ) );
    37         $this->assertInstanceOf( 'IXR_Error', $result );
     37        $this->assertIXRError( $result );
    3838        $this->assertEquals( 401, $result->code );
    3939    }
     
    4141    function test_capable_user() {
    4242        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) );
    43         $this->assertNotInstanceOf( 'IXR_Error', $results );
     43        $this->assertNotIXRError( $results );
    4444
    4545        foreach( $results as $result ) {
     
    6666
    6767        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) );
    68         $this->assertNotInstanceOf( 'IXR_Error', $results );
     68        $this->assertNotIXRError( $results );
    6969
    7070        $found_incapable = false;
    7171        foreach( $results as $result ) {
    7272            // WP#20629
    73             $this->assertNotInstanceOf( 'IXR_Error', $result );
     73            $this->assertNotIXRError( $result );
    7474
    7575            if ( $result['page_id'] == self::$post_id ) {
Note: See TracChangeset for help on using the changeset viewer.