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/wp/getPostTypes.php

    r25002 r40417  
    77        function test_invalid_username_password() {
    88                $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'username', 'password', 'post' ) );
    9                 $this->assertInstanceOf( 'IXR_Error', $result );
     9                $this->assertIXRError( $result );
    1010                $this->assertEquals( 403, $result->code );
    1111        }
    … …  
    1515
    1616                $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'subscriber', 'subscriber' ) );
    17                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     17                $this->assertNotIXRError( $result );
    1818                $this->assertInternalType( 'array', $result );
    1919                $this->assertEquals( 0, count( $result ) );
    … …  
    2424
    2525                $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor' ) );
    26                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     26                $this->assertNotIXRError( $result );
    2727                $this->assertInternalType( 'array', $result );
    2828                $this->assertGreaterThan( 0, count( $result ) );
    … …  
    3333
    3434                $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor', array( 'hierarchical' => true ) ) );
    35                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     35                $this->assertNotIXRError( $result );
    3636                $this->assertInternalType( 'array', $result );
    3737
Note: See TracChangeset for help on using the changeset viewer.