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

    r35242 r40417  
    2424    function test_invalid_username_password() {
    2525        $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'username', 'password', $this->revision_id ) );
    26         $this->assertInstanceOf( 'IXR_Error', $result );
     26        $this->assertIXRError( $result );
    2727        $this->assertEquals( 403, $result->code );
    2828    }
     
    3232
    3333        $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'subscriber', 'subscriber', $this->revision_id ) );
    34         $this->assertInstanceOf( 'IXR_Error', $result );
     34        $this->assertIXRError( $result );
    3535        $this->assertEquals( 401, $result->code );
    3636    }
     
    4040
    4141        $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
    42         $this->assertNotInstanceOf( 'IXR_Error', $result );
     42        $this->assertNotIXRError( $result );
    4343    }
    4444
Note: See TracChangeset for help on using the changeset viewer.