Make WordPress Core


Ignore:
Timestamp:
04/12/2017 02:58:33 PM (10 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/mt/getRecentPostTitles.php

    r35242 r40417  
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'username', 'password' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    … …  
    1616
    1717                $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 500, $result->code );
    2020        }
    … …  
    2626
    2727                $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
    28                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     28                $this->assertNotIXRError( $result );
    2929                $this->assertEquals( 0, count( $result ) );
    3030        }
    … …  
    3636
    3737                $results = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
    38                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     38                $this->assertNotIXRError( $results );
    3939
    4040                foreach( $results as $result ) {
Note: See TracChangeset for help on using the changeset viewer.