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

    r25394 r40417  
    99    function test_invalid_username_password() {
    1010        $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'username', 'password' ) );
    11         $this->assertInstanceOf( 'IXR_Error', $result );
     11        $this->assertIXRError( $result );
    1212        $this->assertEquals( 403, $result->code );
    1313    }
     
    1717
    1818        $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'subscriber', 'subscriber' ) );
    19         $this->assertNotInstanceOf( 'IXR_Error', $result );
     19        $this->assertNotIXRError( $result );
    2020        $this->assertEquals( $subscriber_id, $result['user_id'] );
    2121        $this->assertContains( 'subscriber', $result['roles'] );
     
    2626
    2727        $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'administrator', 'administrator' ) );
    28         $this->assertNotInstanceOf( 'IXR_Error', $result );
     28        $this->assertNotIXRError( $result );
    2929        $this->assertEquals( $administrator_id, $result['user_id'] );
    3030        $this->assertContains( 'administrator', $result['roles'] );
     
    3737
    3838        $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'editor', 'editor', $fields ) );
    39         $this->assertNotInstanceOf( 'IXR_Error', $result );
     39        $this->assertNotIXRError( $result );
    4040        $this->assertEquals( $editor_id, $result['user_id'] );
    4141
Note: See TracChangeset for help on using the changeset viewer.