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/mw/getRecentPosts.php

    r39189 r40417  
    2121    function test_invalid_username_password() {
    2222        $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'username', 'password' ) );
    23         $this->assertInstanceOf( 'IXR_Error', $result );
     23        $this->assertIXRError( $result );
    2424        $this->assertEquals( 403, $result->code );
    2525    }
     
    3232
    3333        $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
    34         $this->assertInstanceOf( 'IXR_Error', $result );
     34        $this->assertIXRError( $result );
    3535        $this->assertEquals( 401, $result->code );
    3636    }
     
    4040
    4141        $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
    42         $this->assertNotInstanceOf( 'IXR_Error', $result );
     42        $this->assertNotIXRError( $result );
    4343        $this->assertEquals( 0, count( $result ) );
    4444    }
     
    4949        $fields = array( 'post' );
    5050        $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
    51         $this->assertNotInstanceOf( 'IXR_Error', $results );
     51        $this->assertNotIXRError( $results );
    5252
    5353        foreach( $results as $result ) {
     
    100100
    101101        $results = $this->myxmlrpcserver->mw_getRecentPosts( array( self::$post_id, 'author', 'author' ) );
    102         $this->assertNotInstanceOf( 'IXR_Error', $results );
     102        $this->assertNotIXRError( $results );
    103103
    104104        foreach( $results as $result ) {
     
    120120
    121121        $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'editor', 'editor' ) );
    122         $this->assertNotInstanceOf( 'IXR_Error', $results );
     122        $this->assertNotIXRError( $results );
    123123
    124124        foreach( $results as $result ) {
Note: See TracChangeset for help on using the changeset viewer.