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

    r35242 r40417  
    88    function test_invalid_username_password() {
    99        $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'username', 'password', 0 ) );
    10         $this->assertInstanceOf( 'IXR_Error', $result );
     10        $this->assertIXRError( $result );
    1111        $this->assertEquals( 403, $result->code );
    1212    }
     
    1616
    1717        $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 340982340 ) );
    18         $this->assertInstanceOf( 'IXR_Error', $result );
     18        $this->assertIXRError( $result );
    1919        $this->assertEquals( 404, $result->code );
    2020    }
     
    2525
    2626        $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) );
    27         $this->assertInstanceOf( 'IXR_Error', $result );
     27        $this->assertIXRError( $result );
    2828        $this->assertEquals( 401, $result->code );
    2929    }
     
    3434
    3535        $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', $post_id ) );
    36         $this->assertNotInstanceOf( 'IXR_Error', $result );
     36        $this->assertNotIXRError( $result );
    3737        $this->assertTrue( $result );
    3838
Note: See TracChangeset for help on using the changeset viewer.