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

    r25002 r40417  
    3232    function test_invalid_username_password() {
    3333        $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'username', 'password', 'post' ) );
    34         $this->assertInstanceOf( 'IXR_Error', $result );
     34        $this->assertIXRError( $result );
    3535        $this->assertEquals( 403, $result->code );
    3636    }
     
    4040
    4141        $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'foobar' ) );
    42         $this->assertInstanceOf( 'IXR_Error', $result );
     42        $this->assertIXRError( $result );
    4343        $this->assertEquals( 403, $result->code );
    4444    }
     
    4848
    4949        $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'post' ) );
    50         $this->assertNotInstanceOf( 'IXR_Error', $result );
     50        $this->assertNotIXRError( $result );
    5151    }
    5252
     
    5555
    5656        $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'subscriber', 'subscriber', 'post' ) );
    57         $this->assertInstanceOf( 'IXR_Error', $result );
     57        $this->assertIXRError( $result );
    5858        $this->assertEquals( 401, $result->code );
    5959    }
     
    6363
    6464        $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', $this->cpt_name, array( 'labels', 'cap', 'menu', 'taxonomies' ) ) );
    65         $this->assertNotInstanceOf( 'IXR_Error', $result );
     65        $this->assertNotIXRError( $result );
    6666
    6767        // check data types
Note: See TracChangeset for help on using the changeset viewer.