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

    r35242 r40417  
    88    function test_invalid_username_password() {
    99        $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
    10         $this->assertInstanceOf( 'IXR_Error', $result );
     10        $this->assertIXRError( $result );
    1111        $this->assertEquals( 403, $result->code );
    1212    }
     
    1818
    1919        $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'subscriber', 'subscriber', $post_id ) );
    20         $this->assertInstanceOf( 'IXR_Error', $result );
     20        $this->assertIXRError( $result );
    2121        $this->assertEquals( 401, $result->code );
    2222    }
     
    2727        $post_id = self::factory()->post->create();
    2828        $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
    29         $this->assertNotInstanceOf( 'IXR_Error', $result );
     29        $this->assertNotIXRError( $result );
    3030    }
    3131
Note: See TracChangeset for help on using the changeset viewer.