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

    r39189 r40417  
    3636    function test_invalid_username_password() {
    3737        $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'username', 'password', self::$parent_comment_id ) );
    38         $this->assertInstanceOf( 'IXR_Error', $result );
     38        $this->assertIXRError( $result );
    3939        $this->assertEquals( 403, $result->code );
    4040    }
     
    4444
    4545        $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'contributor', 'contributor', self::$parent_comment_id ) );
    46         $this->assertInstanceOf( 'IXR_Error', $result );
     46        $this->assertIXRError( $result );
    4747        $this->assertEquals( 403, $result->code );
    4848    }
     
    5252
    5353        $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', self::$parent_comment_id ) );
    54         $this->assertNotInstanceOf( 'IXR_Error', $result );
     54        $this->assertNotIXRError( $result );
    5555
    5656        // Check data types
     
    8888
    8989        $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', self::$child_comment_id ) );
    90         $this->assertNotInstanceOf( 'IXR_Error', $result );
     90        $this->assertNotIXRError( $result );
    9191
    9292        $this->assertEquals( self::$child_comment_id, $result['comment_id'] );
     
    9898
    9999        $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', 123456789 ) );
    100         $this->assertInstanceOf( 'IXR_Error', $result );
     100        $this->assertIXRError( $result );
    101101        $this->assertEquals( 404, $result->code );
    102102    }
Note: See TracChangeset for help on using the changeset viewer.