WordPress.org

Make WordPress Core

Ticket #40423: 40423.implementation.diff

File 40423.implementation.diff, 109.5 KB (added by johnbillion, 4 years ago)
  • tests/phpunit/tests/xmlrpc/basic.php

    diff --git tests/phpunit/tests/xmlrpc/basic.php tests/phpunit/tests/xmlrpc/basic.php
    index bbbcbd7d5d..7818fdb0bf 100644
    class Tests_XMLRPC_Basic extends WP_XMLRPC_UnitTestCase { 
    1111        function test_enabled() {
    1212                $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
    1313
    14                 $this->assertInstanceOf( 'IXR_Error', $result );
     14                $this->assertIXRError( $result );
    1515                // If disabled, 405 would result.
    1616                $this->assertEquals( 403, $result->code );
    1717        }
  • tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php

    diff --git tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php
    index 8d9c027f22..7c36f978ef 100644
    class Tests_XMLRPC_mt_getRecentPostTitles extends WP_XMLRPC_UnitTestCase { 
    77
    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        }
    1313
    class Tests_XMLRPC_mt_getRecentPostTitles extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'author' );
    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        }
    2121
    class Tests_XMLRPC_mt_getRecentPostTitles extends WP_XMLRPC_UnitTestCase { 
    2525                self::factory()->post->create( array( 'post_author' => $editor ) );
    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        }
    3131
    class Tests_XMLRPC_mt_getRecentPostTitles extends WP_XMLRPC_UnitTestCase { 
    3535                self::factory()->post->create();
    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 ) {
    4141                        $post = get_post( $result['postid'] );
  • tests/phpunit/tests/xmlrpc/mw/editPost.php

    diff --git tests/phpunit/tests/xmlrpc/mw/editPost.php tests/phpunit/tests/xmlrpc/mw/editPost.php
    index e265b8898f..39a937d7d5 100644
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    88        function test_invalid_username_password() {
    99                $post = array();
    1010                $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password', $post ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $result );
     11                $this->assertIXRError( $result );
    1212                $this->assertEquals( 403, $result->code );
    1313        }
    1414
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    2020                $new_title = 'Post test (updated)';
    2121                $post2 = array( 'title' => $new_title );
    2222                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
    23                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     23                $this->assertNotIXRError( $result );
    2424                $this->assertTrue($result);
    2525
    2626                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    3737                $new_title = 'Post test (updated)';
    3838                $post2 = array( 'title' => $new_title );
    3939                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
    40                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     40                $this->assertNotIXRError( $result );
    4141                $this->assertTrue($result);
    4242
    4343                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    5555                $new_title = 'Post test (updated)';
    5656                $post2 = array( 'title' => $new_title );
    5757                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
    58                 $this->assertInstanceOf( 'IXR_Error', $result );
     58                $this->assertIXRError( $result );
    5959                $this->assertEquals( 401, $result->code );
    6060
    6161                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    7272
    7373                $post2 = array( 'wp_author_id' => $author_id );
    7474                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
    75                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     75                $this->assertNotIXRError( $result );
    7676                $this->assertTrue($result);
    7777
    7878                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    8888
    8989                $post2 = array( 'wp_author_id' => $author_id );
    9090                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
    91                 $this->assertInstanceOf( 'IXR_Error', $result );
     91                $this->assertIXRError( $result );
    9292                $this->assertEquals( 401, $result->code );
    9393
    9494                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    107107
    108108                $post2 = array( 'wp_author_id' => $editor_id );
    109109                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
    110                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     110                $this->assertNotIXRError( $result );
    111111                $this->assertTrue($result);
    112112
    113113                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    131131                // add post thumbnail to post that does not have one
    132132                $post2 = array( 'wp_post_thumbnail' => $attachment_id );
    133133                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post2 ) );
    134                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     134                $this->assertNotIXRError( $result );
    135135                $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    136136
    137137                // edit the post without supplying a post_thumbnail and check that it didn't change
    138138                $post3 = array( 'post_content' => 'Updated post' );
    139139                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post3 ) );
    140                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     140                $this->assertNotIXRError( $result );
    141141                $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    142142
    143143                // create another attachment
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    146146                // change the post's post_thumbnail
    147147                $post4 = array( 'wp_post_thumbnail' => $attachment2_id );
    148148                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post4 ) );
    149                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     149                $this->assertNotIXRError( $result );
    150150                $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    151151
    152152                // unset the post's post_thumbnail
    153153                $post5 = array( 'wp_post_thumbnail' => '' );
    154154                $result = $this->myxmlrpcserver->mw_editPost( array($post_id, 'author', 'author', $post5 ) );
    155                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     155                $this->assertNotIXRError( $result );
    156156                $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
    157157
    158158                remove_theme_support( 'post-thumbnails' );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    166166
    167167                $post2 = array( 'title' => 'New Title', 'post_author' => $contributor_id );
    168168                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
    169                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     169                $this->assertNotIXRError( $result );
    170170                $this->assertTrue($result);
    171171
    172172                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    174174
    175175                $post3 = array( 'description' => 'New Content', 'post_author' => $contributor_id );
    176176                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post3 ) );
    177                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     177                $this->assertNotIXRError( $result );
    178178                $this->assertTrue($result);
    179179
    180180                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    183183
    184184                $post4 = array( 'mt_excerpt' => 'New Excerpt', 'post_author' => $contributor_id );
    185185                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post4 ) );
    186                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     186                $this->assertNotIXRError( $result );
    187187                $this->assertTrue($result);
    188188
    189189                $out = get_post( $post_id );
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    202202                $post_id = wp_insert_post( $post );
    203203
    204204                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array( 'sticky' => '1' ) ) );
    205                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     205                $this->assertNotIXRError( $result );
    206206                $this->assertTrue( $result );
    207207        }
    208208
    class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase { 
    215215
    216216                $post2 = array( 'post_type' => 'page' );
    217217                $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
    218                 $this->assertInstanceOf( 'IXR_Error', $result );
     218                $this->assertIXRError( $result );
    219219                $this->assertEquals( $result->code, 401 );
    220220        }
    221221
  • tests/phpunit/tests/xmlrpc/mw/getPost.php

    diff --git tests/phpunit/tests/xmlrpc/mw/getPost.php tests/phpunit/tests/xmlrpc/mw/getPost.php
    index 0d433d0804..924d6ff897 100644
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    1919
    2020        function test_invalid_username_password() {
    2121                $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'username', 'password' ) );
    22                 $this->assertInstanceOf( 'IXR_Error', $result );
     22                $this->assertIXRError( $result );
    2323                $this->assertEquals( 403, $result->code );
    2424        }
    2525
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    2727                $this->make_user_by_role( 'subscriber' );
    2828
    2929                $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'subscriber', 'subscriber' ) );
    30                 $this->assertInstanceOf( 'IXR_Error', $result );
     30                $this->assertIXRError( $result );
    3131                $this->assertEquals( 401, $result->code );
    3232        }
    3333
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    3636         */
    3737        function test_invalid_postid() {
    3838                $result = $this->myxmlrpcserver->mw_getPost( array( 9999, 'author', 'author' ) );
    39                 $this->assertInstanceOf( 'IXR_Error', $result );
     39                $this->assertIXRError( $result );
    4040                $this->assertEquals( 404, $result->code );
    4141        }
    4242
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    4545
    4646                $fields = array( 'post' );
    4747                $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
    48                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     48                $this->assertNotIXRError( $result );
    4949
    5050                // Check data types
    5151                $this->assertInternalType( 'string', $result['userid'] );
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    9696
    9797                $fields = array( 'post' );
    9898                $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
    99                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     99                $this->assertNotIXRError( $result );
    100100
    101101                $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
    102102                $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] );
    class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase { 
    108108        function test_date() {
    109109                $fields = array( 'post' );
    110110                $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) );
    111                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     111                $this->assertNotIXRError( $result );
    112112
    113113                $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
    114114                $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
  • tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php

    diff --git tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php
    index a3b7cd4074..8ab76274b4 100644
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    2020
    2121        function test_invalid_username_password() {
    2222                $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'username', 'password' ) );
    23                 $this->assertInstanceOf( 'IXR_Error', $result );
     23                $this->assertIXRError( $result );
    2424                $this->assertEquals( 403, $result->code );
    2525        }
    2626
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    3131                $this->make_user_by_role( 'subscriber' );
    3232
    3333                $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
    34                 $this->assertInstanceOf( 'IXR_Error', $result );
     34                $this->assertIXRError( $result );
    3535                $this->assertEquals( 401, $result->code );
    3636        }
    3737
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    3939                wp_delete_post( self::$post_id, true );
    4040
    4141                $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
    42                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     42                $this->assertNotIXRError( $result );
    4343                $this->assertEquals( 0, count( $result ) );
    4444        }
    4545
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    4848
    4949                $fields = array( 'post' );
    5050                $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
    51                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     51                $this->assertNotIXRError( $results );
    5252
    5353                foreach( $results as $result ) {
    5454                        $post = get_post( $result['postid'] );
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    9999                set_post_thumbnail( self::$post_id, $attachment_id );
    100100
    101101                $results = $this->myxmlrpcserver->mw_getRecentPosts( array( self::$post_id, 'author', 'author' ) );
    102                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     102                $this->assertNotIXRError( $results );
    103103
    104104                foreach( $results as $result ) {
    105105                        $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
    class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase { 
    119119                $this->make_user_by_role( 'editor' );
    120120
    121121                $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'editor', 'editor' ) );
    122                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     122                $this->assertNotIXRError( $results );
    123123
    124124                foreach( $results as $result ) {
    125125                        $post = get_post( $result['postid'] );
  • tests/phpunit/tests/xmlrpc/mw/newPost.php

    diff --git tests/phpunit/tests/xmlrpc/mw/newPost.php tests/phpunit/tests/xmlrpc/mw/newPost.php
    index 01316e62d5..06aaafc77f 100644
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    88        function test_invalid_username_password() {
    99                $post = array();
    1010                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $result );
     11                $this->assertIXRError( $result );
    1212                $this->assertEquals( 403, $result->code );
    1313        }
    1414
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    1717
    1818                $post = array();
    1919                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) );
    20                 $this->assertInstanceOf( 'IXR_Error', $result );
     20                $this->assertIXRError( $result );
    2121                $this->assertEquals( 401, $result->code );
    2222        }
    2323
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    2626
    2727                $post = array();
    2828                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    29                 $this->assertInstanceOf( 'IXR_Error', $result );
     29                $this->assertIXRError( $result );
    3030                $this->assertEquals( 500, $result->code );
    3131                $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
    3232        }
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    3636
    3737                $post = array( 'title' => 'Test' );
    3838                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    39                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     39                $this->assertNotIXRError( $result );
    4040                $this->assertStringMatchesFormat( '%d', $result );
    4141        }
    4242
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    4545
    4646                $post = array( 'title' => 'Test', 'ID' => 103948 );
    4747                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    48                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     48                $this->assertNotIXRError( $result );
    4949                $this->assertNotEquals( '103948', $result );
    5050        }
    5151
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    5454
    5555                $post = array( 'title' => 'Test', 'post_status' => 'publish' );
    5656                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    57                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     57                $this->assertNotIXRError( $result );
    5858        }
    5959
    6060        function test_incapable_publish() {
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    6262
    6363                $post = array( 'title' => 'Test', 'post_status' => 'publish' );
    6464                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
    65                 $this->assertInstanceOf( 'IXR_Error', $result );
     65                $this->assertIXRError( $result );
    6666                $this->assertEquals( 401, $result->code );
    6767        }
    6868
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    7272
    7373                $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
    7474                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
    75                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     75                $this->assertNotIXRError( $result );
    7676        }
    7777
    7878        function test_incapable_other_author() {
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    8181
    8282                $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
    8383                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
    84                 $this->assertInstanceOf( 'IXR_Error', $result );
     84                $this->assertIXRError( $result );
    8585                $this->assertEquals( 401, $result->code );
    8686        }
    8787
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    9393
    9494                $post = array( 'title' => 'Test', 'wp_author_id' => 99999999 );
    9595                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
    96                 $this->assertInstanceOf( 'IXR_Error', $result );
     96                $this->assertIXRError( $result );
    9797                $this->assertEquals( 404, $result->code );
    9898        }
    9999
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    102102
    103103                $post = array( 'title' => 'Test' );
    104104                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    105                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     105                $this->assertNotIXRError( $result );
    106106                $this->assertStringMatchesFormat( '%d', $result );
    107107
    108108                $out = get_post( $result );
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    121121
    122122                $post = array( 'title' => 'Post Thumbnail Test', 'wp_post_thumbnail' => $attachment_id );
    123123                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    124                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     124                $this->assertNotIXRError( $result );
    125125                $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
    126126
    127127                remove_theme_support( 'post-thumbnails' );
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    132132
    133133                $post = array( 'title' => 'Test', 'post_type' => 'page' );
    134134                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
    135                 $this->assertInstanceOf( 'IXR_Error', $result );
     135                $this->assertIXRError( $result );
    136136                $this->assertEquals( 401, $result->code );
    137137        }
    138138
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    141141
    142142                $post = array( 'title' => 'Test', 'post_type' => 'page' );
    143143                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
    144                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     144                $this->assertNotIXRError( $result );
    145145                $this->assertStringMatchesFormat( '%d', $result );
    146146
    147147                $out = get_post( $result );
    class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase { 
    162162                        'post_status' => 'draft'
    163163                );
    164164                $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
    165                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     165                $this->assertNotIXRError( $result );
    166166                $this->assertStringMatchesFormat( '%d', $result );
    167167
    168168                $out = get_post( $result );
  • tests/phpunit/tests/xmlrpc/wp/deletePost.php

    diff --git tests/phpunit/tests/xmlrpc/wp/deletePost.php tests/phpunit/tests/xmlrpc/wp/deletePost.php
    index e7284a7cde..d2a5bc6460 100644
    class Tests_XMLRPC_wp_deletePost extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'username', 'password', 0 ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_deletePost extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'editor' );
    1616
    1717                $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 340982340 ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 404, $result->code );
    2020        }
    2121
    class Tests_XMLRPC_wp_deletePost extends WP_XMLRPC_UnitTestCase { 
    2424                $post_id = self::factory()->post->create();
    2525
    2626                $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) );
    27                 $this->assertInstanceOf( 'IXR_Error', $result );
     27                $this->assertIXRError( $result );
    2828                $this->assertEquals( 401, $result->code );
    2929        }
    3030
    class Tests_XMLRPC_wp_deletePost extends WP_XMLRPC_UnitTestCase { 
    3333                $post_id = self::factory()->post->create();
    3434
    3535                $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', $post_id ) );
    36                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     36                $this->assertNotIXRError( $result );
    3737                $this->assertTrue( $result );
    3838
    3939                $post = get_post( $post_id );
  • tests/phpunit/tests/xmlrpc/wp/deleteTerm.php

    diff --git tests/phpunit/tests/xmlrpc/wp/deleteTerm.php tests/phpunit/tests/xmlrpc/wp/deleteTerm.php
    index ee95c6ae76..94e25c9c3d 100644
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    1414
    1515        function test_invalid_username_password() {
    1616                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password', 'category', 0 ) );
    17                 $this->assertInstanceOf( 'IXR_Error', $result );
     17                $this->assertIXRError( $result );
    1818                $this->assertEquals( 403, $result->code );
    1919        }
    2020
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    2222                $this->make_user_by_role( 'subscriber' );
    2323
    2424                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
    25                 $this->assertInstanceOf( 'IXR_Error', $result );
     25                $this->assertIXRError( $result );
    2626                $this->assertEquals( 403, $result->code );
    2727                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    2828        }
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    3131                $this->make_user_by_role( 'subscriber' );
    3232
    3333                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
    34                 $this->assertInstanceOf( 'IXR_Error', $result );
     34                $this->assertIXRError( $result );
    3535                $this->assertEquals( 403, $result->code );
    3636                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3737        }
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    4040                $this->make_user_by_role( 'subscriber' );
    4141
    4242                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
    43                 $this->assertInstanceOf( 'IXR_Error', $result );
     43                $this->assertIXRError( $result );
    4444                $this->assertEquals( 401, $result->code );
    4545                $this->assertEquals( __( 'Sorry, you are not allowed to delete this term.' ), $result->message );
    4646        }
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    4949                $this->make_user_by_role( 'editor' );
    5050
    5151                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) );
    52                 $this->assertInstanceOf( 'IXR_Error', $result );
     52                $this->assertIXRError( $result );
    5353                $this->assertEquals( 500, $result->code );
    5454                $this->assertEquals( __('Empty Term'), $result->message );
    5555        }
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    5858                $this->make_user_by_role( 'editor' );
    5959
    6060                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
    61                 $this->assertInstanceOf( 'IXR_Error', $result );
     61                $this->assertIXRError( $result );
    6262                $this->assertEquals( 404, $result->code );
    6363                $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
    6464        }
    class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { 
    6767                $this->make_user_by_role( 'editor' );
    6868
    6969                $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) );
    70                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     70                $this->assertNotIXRError( $result );
    7171                $this->assertInternalType( 'boolean', $result );
    7272        }
    7373}
  • tests/phpunit/tests/xmlrpc/wp/editComment.php

    diff --git tests/phpunit/tests/xmlrpc/wp/editComment.php tests/phpunit/tests/xmlrpc/wp/editComment.php
    index b43beb6ee0..fcb3bb57f7 100644
    class Tests_XMLRPC_wp_editComment extends WP_XMLRPC_UnitTestCase { 
    2222                $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'author', 'author', $comment_id, array(
    2323                        'status' => 'hold'
    2424                ) ) );
    25                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     25                $this->assertNotIXRError( $result );
    2626                $this->assertTrue( $result );
    2727        }
    2828
    class Tests_XMLRPC_wp_editComment extends WP_XMLRPC_UnitTestCase { 
    4242                ) );
    4343
    4444                $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'author', 'author', $comment_id, array( 'status' => 'hold' ) ) );
    45                 $this->assertInstanceOf( 'IXR_Error', $result );
     45                $this->assertIXRError( $result );
    4646                $this->assertEquals( 403, $result->code );
    4747                $this->assertEquals( __( 'Sorry, you are not allowed to moderate or edit this comment.' ), $result->message );
    4848        }
  • tests/phpunit/tests/xmlrpc/wp/editPost.php

    diff --git tests/phpunit/tests/xmlrpc/wp/editPost.php tests/phpunit/tests/xmlrpc/wp/editPost.php
    index 373d45870a..55f5be99a7 100644
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'username', 'password', 0, array() ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    2020                $new_title = 'Post test (updated)';
    2121                $post2 = array( 'post_title' => $new_title );
    2222                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
    23                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     23                $this->assertNotIXRError( $result );
    2424                $this->assertTrue($result);
    2525
    2626                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    3737                $new_title = 'Post test (updated)';
    3838                $post2 = array( 'post_title' => $new_title );
    3939                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
    40                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     40                $this->assertNotIXRError( $result );
    4141                $this->assertTrue($result);
    4242
    4343                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    5555                $new_title = 'Post test (updated)';
    5656                $post2 = array( 'post_title' => $new_title );
    5757                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
    58                 $this->assertInstanceOf( 'IXR_Error', $result );
     58                $this->assertIXRError( $result );
    5959                $this->assertEquals( 401, $result->code );
    6060
    6161                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    7272
    7373                $post2 = array( 'post_author' => $author_id );
    7474                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
    75                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     75                $this->assertNotIXRError( $result );
    7676                $this->assertTrue($result);
    7777
    7878                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    8888
    8989                $post2 = array( 'post_author' => $author_id );
    9090                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
    91                 $this->assertInstanceOf( 'IXR_Error', $result );
     91                $this->assertIXRError( $result );
    9292                $this->assertEquals( 401, $result->code );
    9393
    9494                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    107107
    108108                $post2 = array( 'post_author' => $editor_id );
    109109                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
    110                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     110                $this->assertNotIXRError( $result );
    111111                $this->assertTrue($result);
    112112
    113113                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    131131                // add post thumbnail to post that does not have one
    132132                $post2 = array( 'post_thumbnail' => $attachment_id );
    133133                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post2 ) );
    134                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     134                $this->assertNotIXRError( $result );
    135135                $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    136136
    137137                // fetch the post to verify that it appears
    138138                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $post_id ) );
    139                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     139                $this->assertNotIXRError( $result );
    140140                $this->assertArrayHasKey( 'post_thumbnail', $result );
    141141                $this->assertInternalType( 'array', $result['post_thumbnail'] );
    142142                $this->assertEquals( $attachment_id, $result['post_thumbnail']['attachment_id'] );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    144144                // edit the post without supplying a post_thumbnail and check that it didn't change
    145145                $post3 = array( 'post_content' => 'Updated post' );
    146146                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post3 ) );
    147                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     147                $this->assertNotIXRError( $result );
    148148                $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    149149
    150150                // create another attachment
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    153153                // change the post's post_thumbnail
    154154                $post4 = array( 'post_thumbnail' => $attachment2_id );
    155155                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post4 ) );
    156                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     156                $this->assertNotIXRError( $result );
    157157                $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
    158158
    159159                // unset the post's post_thumbnail
    160160                $post5 = array( 'post_thumbnail' => '' );
    161161                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post5 ) );
    162                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     162                $this->assertNotIXRError( $result );
    163163                $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
    164164
    165165                // use invalid ID
    166166                $post6 = array( 'post_thumbnail' => 398420983409 );
    167167                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post6 ) );
    168                 $this->assertInstanceOf( 'IXR_Error', $result );
     168                $this->assertIXRError( $result );
    169169                $this->assertEquals( 404, $result->code );
    170170
    171171                remove_theme_support( 'post-thumbnails' );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    191191                );
    192192
    193193                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
    194                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     194                $this->assertNotIXRError( $result );
    195195                $this->assertTrue($result);
    196196
    197197                $out = get_post( $post_id );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    213213
    214214                $post2 = array( 'sticky' => false );
    215215                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
    216                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     216                $this->assertNotIXRError( $result );
    217217                $this->assertFalse( is_sticky( $post_id ) );
    218218        }
    219219
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    225225
    226226                $post2 = array( 'post_password' => 'foobar',  'sticky' => false );
    227227                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
    228                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     228                $this->assertNotIXRError( $result );
    229229                $this->assertFalse( is_sticky( $post_id ) );
    230230        }
    231231
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    245245                // Modify the day old post. In this case, we think it was last modified yesterday.
    246246                $struct = array( 'post_content' => 'First edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
    247247                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
    248                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     248                $this->assertNotIXRError( $result );
    249249
    250250                // Make sure the edit went through.
    251251                $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    253253                // Modify it again. We think it was last modified yesterday, but we actually just modified it above.
    254254                $struct = array( 'post_content' => 'Second edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
    255255                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
    256                 $this->assertInstanceOf( 'IXR_Error', $result );
     256                $this->assertIXRError( $result );
    257257                $this->assertEquals( 409, $result->code );
    258258
    259259                // Make sure the edit did not go through.
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    273273
    274274                $struct = array( 'post_content' => 'First edit' );
    275275                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
    276                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     276                $this->assertNotIXRError( $result );
    277277
    278278                // Make sure that the post status is still inherit
    279279                $this->assertEquals( 'inherit', get_post( $post_id )->post_status );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    290290
    291291                $struct = array( 'post_status' => 'doesnt_exists' );
    292292                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
    293                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     293                $this->assertNotIXRError( $result );
    294294
    295295                // Make sure that the post status is still inherit
    296296                $this->assertEquals( 'draft', get_post( $post_id )->post_status );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    309309                $this->assertContains( $term_id, $term_ids );
    310310
    311311                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, array( 'ID' => $post_id, 'post_title' => 'Updated' ) ) );
    312                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     312                $this->assertNotIXRError( $result );
    313313                $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
    314314
    315315                $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
    class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { 
    336336                        )
    337337                );
    338338                $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) );
    339                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     339                $this->assertNotIXRError( $result );
    340340                $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
    341341
    342342                $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
  • tests/phpunit/tests/xmlrpc/wp/editProfile.php

    diff --git tests/phpunit/tests/xmlrpc/wp/editProfile.php tests/phpunit/tests/xmlrpc/wp/editProfile.php
    index 525f6a5652..6e3ced529a 100644
    class Tests_XMLRPC_wp_editProfile extends WP_XMLRPC_UnitTestCase { 
    88
    99        function test_invalid_username_password() {
    1010                $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'username', 'password', array() ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $result );
     11                $this->assertIXRError( $result );
    1212                $this->assertEquals( 403, $result->code );
    1313        }
    1414
    class Tests_XMLRPC_wp_editProfile extends WP_XMLRPC_UnitTestCase { 
    2525            'bio' => rand_str(200)
    2626        );
    2727        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'subscriber', 'subscriber', $new_data ) );
    28         $this->assertNotInstanceOf( 'IXR_Error', $result );
     28        $this->assertNotIXRError( $result );
    2929        $this->assertTrue( $result );
    3030
    3131        // verify that the new values were stored
    class Tests_XMLRPC_wp_editProfile extends WP_XMLRPC_UnitTestCase { 
    4545        $new_data = array( 'password' => $new_pass );
    4646
    4747        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'author', 'author', $new_data ) );
    48         $this->assertNotInstanceOf( 'IXR_Error', $result );
     48        $this->assertNotIXRError( $result );
    4949        $this->assertTrue( $result );
    5050
    5151        $auth_old = wp_authenticate( 'author', 'author' );
    class Tests_XMLRPC_wp_editProfile extends WP_XMLRPC_UnitTestCase { 
    6060        $new_data = array( 'email' => $new_email );
    6161
    6262        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'editor', 'editor', $new_data ) );
    63         $this->assertNotInstanceOf( 'IXR_Error', $result );
     63        $this->assertNotIXRError( $result );
    6464        $this->assertTrue( $result );
    6565
    6666        $user_data = get_userdata( $editor_id );
  • tests/phpunit/tests/xmlrpc/wp/editTerm.php

    diff --git tests/phpunit/tests/xmlrpc/wp/editTerm.php tests/phpunit/tests/xmlrpc/wp/editTerm.php
    index b3f22d2a24..1e62de9d1f 100644
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    2222
    2323        function test_invalid_username_password() {
    2424                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) );
    25                 $this->assertInstanceOf( 'IXR_Error', $result );
     25                $this->assertIXRError( $result );
    2626                $this->assertEquals( 403, $result->code );
    2727        }
    2828
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    3030                $this->make_user_by_role( 'subscriber' );
    3131
    3232                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) );
    33                 $this->assertInstanceOf( 'IXR_Error', $result );
     33                $this->assertIXRError( $result );
    3434                $this->assertEquals( 403, $result->code );
    3535                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3636        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    3939                $this->make_user_by_role( 'subscriber' );
    4040
    4141                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'not_existing' ) ) );
    42                 $this->assertInstanceOf( 'IXR_Error', $result );
     42                $this->assertIXRError( $result );
    4343                $this->assertEquals( 403, $result->code );
    4444                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    4545        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    4848                $this->make_user_by_role( 'subscriber' );
    4949
    5050                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'category' ) ) );
    51                 $this->assertInstanceOf( 'IXR_Error', $result );
     51                $this->assertIXRError( $result );
    5252                $this->assertEquals( 401, $result->code );
    5353                $this->assertEquals( __( 'Sorry, you are not allowed to edit this term.' ), $result->message );
    5454        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    5757                $this->make_user_by_role( 'editor' );
    5858
    5959                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) );
    60                 $this->assertInstanceOf( 'IXR_Error', $result );
     60                $this->assertIXRError( $result );
    6161                $this->assertEquals( 404, $result->code );
    6262                $this->assertEquals(  __( 'Invalid term ID.' ), $result->message );
    6363        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    6666                $this->make_user_by_role( 'editor' );
    6767
    6868                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) );
    69                 $this->assertInstanceOf( 'IXR_Error', $result );
     69                $this->assertIXRError( $result );
    7070                $this->assertEquals( 500, $result->code );
    7171                $this->assertEquals( __('Empty Term'), $result->message );
    7272        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    7575                $this->make_user_by_role( 'editor' );
    7676
    7777                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$parent_term, array( 'taxonomy' => 'category', 'name' => '' ) ) );
    78                 $this->assertInstanceOf( 'IXR_Error', $result );
     78                $this->assertIXRError( $result );
    7979                $this->assertEquals( 403, $result->code );
    8080                $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
    8181        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    8484                $this->make_user_by_role( 'editor' );
    8585
    8686                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$post_tag, array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term ) ) );
    87                 $this->assertInstanceOf( 'IXR_Error', $result );
     87                $this->assertIXRError( $result );
    8888                $this->assertEquals( 403, $result->code );
    8989                $this->assertEquals( __( "This taxonomy is not hierarchical so you can't set a parent." ), $result->message );
    9090        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    9393                $this->make_user_by_role( 'editor' );
    9494
    9595                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) );
    96                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     96                $this->assertNotIXRError( $result );
    9797                $this->assertTrue( $result );
    9898        }
    9999
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    102102
    103103                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) );
    104104
    105                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     105                $this->assertNotIXRError( $result );
    106106                $this->assertInternalType( 'boolean', $result );
    107107
    108108                $term = get_term( self::$child_term, 'category' );
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    113113                $this->make_user_by_role( 'editor' );
    114114
    115115                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
    116                 $this->assertInstanceOf( 'IXR_Error', $result );
     116                $this->assertIXRError( $result );
    117117                $this->assertEquals( 500, $result->code );
    118118        }
    119119
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    121121                $this->make_user_by_role( 'editor' );
    122122
    123123                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
    124                 $this->assertInstanceOf( 'IXR_Error', $result );
     124                $this->assertIXRError( $result );
    125125                $this->assertEquals( 403, $result->code );
    126126                $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
    127127        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    131131
    132132                $parent_term = get_term_by( 'id', self::$parent_term, 'category' );
    133133                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) );
    134                 $this->assertInstanceOf( 'IXR_Error', $result );
     134                $this->assertIXRError( $result );
    135135                $this->assertEquals( 500, $result->code );
    136136                $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term'), $parent_term->slug ) ), $result->message );
    137137        }
    class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { 
    142142                $fields = array( 'taxonomy' => 'category', 'name' => 'Child 2', 'parent' => self::$parent_term, 'description' => 'Child term', 'slug' => 'child_2' );
    143143                $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, $fields ) );
    144144
    145                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     145                $this->assertNotIXRError( $result );
    146146                $this->assertInternalType( 'boolean', $result );
    147147        }
    148148}
  • tests/phpunit/tests/xmlrpc/wp/getComment.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getComment.php tests/phpunit/tests/xmlrpc/wp/getComment.php
    index d66ccd8a0e..57ad8995f1 100644
    class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase { 
    3535
    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        }
    4141
    class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase { 
    4343                $this->make_user_by_role( 'contributor' );
    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        }
    4949
    class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase { 
    5151                $this->make_user_by_role( 'editor' );
    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
    5757                $this->assertInternalType( 'string', $result['user_id'] );
    class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase { 
    8787                $this->make_user_by_role( 'editor' );
    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'] );
    9393                $this->assertEquals( self::$parent_comment_id, $result['parent'] );
    class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase { 
    9797                $this->make_user_by_role( 'editor' );
    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        }
    103103}
     104 No newline at end of file
  • tests/phpunit/tests/xmlrpc/wp/getComments.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getComments.php tests/phpunit/tests/xmlrpc/wp/getComments.php
    index a4bdf22333..49b72535b7 100644
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    88
    99        function test_invalid_username_password() {
    1010                $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $result );
     11                $this->assertIXRError( $result );
    1212                $this->assertEquals( 403, $result->code );
    1313        }
    1414
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    1616                $this->make_user_by_role( 'contributor' );
    1717
    1818                $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor', array() ) );
    19                 $this->assertInstanceOf( 'IXR_Error', $result );
     19                $this->assertIXRError( $result );
    2020                $this->assertEquals( 401, $result->code );
    2121        }
    2222
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    2727                $this->make_user_by_role( 'editor' );
    2828
    2929                $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array() ) );
    30                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     30                $this->assertNotIXRError( $results );
    3131
    3232                foreach( $results as $result ) {
    3333                        $comment = get_comment( $result['comment_id'], ARRAY_A );
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    4444                $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array(
    4545                        'post_id' => $this->post_id
    4646                ) ) );
    47                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     47                $this->assertNotIXRError( $results );
    4848
    4949                foreach( $results as $result ) {
    5050                        $this->assertEquals( $this->post_id, $result['post_id'] );
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    6060                $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array(
    6161                        'post_id' => $this->post_id,
    6262                ) ) );
    63                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     63                $this->assertNotIXRError( $results );
    6464
    6565                // if no 'number' filter is specified, default should be 10
    6666                $this->assertCount( 10, $results );
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    6969                        'post_id' => $this->post_id,
    7070                        'number' => 5
    7171                ) ) );
    72                 $this->assertNotInstanceOf( 'IXR_Error', $results2 );
     72                $this->assertNotIXRError( $results2 );
    7373                $this->assertCount( 5, $results2 );
    7474        }
    7575
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    104104                ) );
    105105
    106106                $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor' ) );
    107                 $this->assertInstanceOf( 'IXR_Error', $result );
     107                $this->assertIXRError( $result );
    108108                $this->assertEquals( 401, $result->code );
    109109        }
    110110
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    140140                $result1 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
    141141                        'post_id' => $author_post_id
    142142                ) ) );
    143                 $this->assertInstanceOf( 'IXR_Error', $result1 );
     143                $this->assertIXRError( $result1 );
    144144
    145145                $result2 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
    146146                        'status' => 'approve',
    class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase { 
    153153                $result3 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
    154154                        'post_id' => $editor_post_id
    155155                ) ) );
    156                 $this->assertInstanceOf( 'IXR_Error', $result3 );
     156                $this->assertIXRError( $result3 );
    157157
    158158                $result4 = $this->myxmlrpcserver->wp_getComments( array( 1, 'author', 'author', array(
    159159                        'status' => 'approve',
  • tests/phpunit/tests/xmlrpc/wp/getMediaItem.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getMediaItem.php tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
    index 7b99dd5a04..a091f1c2b6 100644
    class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase { 
    3838
    3939        function test_invalid_username_password() {
    4040                $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password', 0 ) );
    41                 $this->assertInstanceOf( 'IXR_Error', $result );
     41                $this->assertIXRError( $result );
    4242                $this->assertEquals( 403, $result->code );
    4343        }
    4444
    class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase { 
    4747
    4848                $fields = array( 'post' );
    4949                $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'author', 'author', $this->attachment_id, $fields ) );
    50                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     50                $this->assertNotIXRError( $result );
    5151
    5252                // Check data types
    5353                $this->assertInternalType( 'string', $result['attachment_id'] );
  • tests/phpunit/tests/xmlrpc/wp/getOptions.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getOptions.php tests/phpunit/tests/xmlrpc/wp/getOptions.php
    index 8b095f65c5..0dffcff231 100644
    class Tests_XMLRPC_wp_getOptions extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
  • tests/phpunit/tests/xmlrpc/wp/getPage.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPage.php tests/phpunit/tests/xmlrpc/wp/getPage.php
    index 0f377b13b8..eb57239c95 100644
    class Tests_XMLRPC_wp_getPage extends WP_XMLRPC_UnitTestCase { 
    2020
    2121        function test_invalid_username_password() {
    2222                $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'username', 'password' ) );
    23                 $this->assertInstanceOf( 'IXR_Error', $result );
     23                $this->assertIXRError( $result );
    2424                $this->assertEquals( 403, $result->code );
    2525        }
    2626
    class Tests_XMLRPC_wp_getPage extends WP_XMLRPC_UnitTestCase { 
    3131                $this->make_user_by_role( 'editor' );
    3232
    3333                $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
    34                 $this->assertInstanceOf( 'IXR_Error', $result );
     34                $this->assertIXRError( $result );
    3535                $this->assertEquals( 404, $result->code );
    3636        }
    3737
    class Tests_XMLRPC_wp_getPage extends WP_XMLRPC_UnitTestCase { 
    3939                $this->make_user_by_role( 'editor' );
    4040
    4141                $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
    42                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     42                $this->assertNotIXRError( $result );
    4343
    4444                // Check data types
    4545                $this->assertInternalType( 'string', $result['userid'] );
    class Tests_XMLRPC_wp_getPage extends WP_XMLRPC_UnitTestCase { 
    8080                $this->make_user_by_role( 'editor' );
    8181
    8282                $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'editor', 'editor' ) );
    83                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     83                $this->assertNotIXRError( $result );
    8484
    8585                $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
    8686                $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
  • tests/phpunit/tests/xmlrpc/wp/getPageList.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPageList.php tests/phpunit/tests/xmlrpc/wp/getPageList.php
    index ef8f793ca1..0e924c4ef4 100644
    class Tests_XMLRPC_wp_getPageList extends WP_XMLRPC_UnitTestCase { 
    2020
    2121        function test_invalid_username_password() {
    2222                $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'username', 'password' ) );
    23                 $this->assertInstanceOf( 'IXR_Error', $result );
     23                $this->assertIXRError( $result );
    2424                $this->assertEquals( 403, $result->code );
    2525        }
    2626
    class Tests_XMLRPC_wp_getPageList extends WP_XMLRPC_UnitTestCase { 
    2828                $this->make_user_by_role( 'contributor' );
    2929
    3030                $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'contributor', 'contributor' ) );
    31                 $this->assertInstanceOf( 'IXR_Error', $result );
     31                $this->assertIXRError( $result );
    3232                $this->assertEquals( 401, $result->code );
    3333        }
    3434
    class Tests_XMLRPC_wp_getPageList extends WP_XMLRPC_UnitTestCase { 
    3636                $this->make_user_by_role( 'editor' );
    3737
    3838                $results = $this->myxmlrpcserver->wp_getPageList( array( 1, 'editor', 'editor' ) );
    39                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     39                $this->assertNotIXRError( $results );
    4040
    4141                foreach( $results as $result ) {
    4242                        $page = get_post( $result->page_id );
  • tests/phpunit/tests/xmlrpc/wp/getPages.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPages.php tests/phpunit/tests/xmlrpc/wp/getPages.php
    index 424238794a..f528d832ff 100644
    class Tests_XMLRPC_wp_getPages extends WP_XMLRPC_UnitTestCase { 
    2626
    2727        function test_invalid_username_password() {
    2828                $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
    29                 $this->assertInstanceOf( 'IXR_Error', $result );
     29                $this->assertIXRError( $result );
    3030                $this->assertEquals( 403, $result->code );
    3131        }
    3232
    class Tests_XMLRPC_wp_getPages extends WP_XMLRPC_UnitTestCase { 
    3434                $this->make_user_by_role( 'contributor' );
    3535
    3636                $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'contributor', 'contributor' ) );
    37                 $this->assertInstanceOf( 'IXR_Error', $result );
     37                $this->assertIXRError( $result );
    3838                $this->assertEquals( 401, $result->code );
    3939        }
    4040
    4141        function test_capable_user() {
    4242                $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) );
    43                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     43                $this->assertNotIXRError( $results );
    4444
    4545                foreach( $results as $result ) {
    4646                        $page = get_post( $result['page_id'] );
    class Tests_XMLRPC_wp_getPages extends WP_XMLRPC_UnitTestCase { 
    6565                add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap') , 10, 4 );
    6666
    6767                $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) );
    68                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     68                $this->assertNotIXRError( $results );
    6969
    7070                $found_incapable = false;
    7171                foreach( $results as $result ) {
    7272                        // WP#20629
    73                         $this->assertNotInstanceOf( 'IXR_Error', $result );
     73                        $this->assertNotIXRError( $result );
    7474
    7575                        if ( $result['page_id'] == self::$post_id ) {
    7676                                $found_incapable = true;
  • tests/phpunit/tests/xmlrpc/wp/getPost.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPost.php tests/phpunit/tests/xmlrpc/wp/getPost.php
    index 6e6ecaeae9..b33f8a3021 100644
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    2727
    2828        function test_invalid_username_password() {
    2929                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password', 1 ) );
    30                 $this->assertInstanceOf( 'IXR_Error', $result );
     30                $this->assertIXRError( $result );
    3131                $this->assertEquals( 403, $result->code );
    3232        }
    3333
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    3636
    3737                $fields = array( 'post', 'custom_fields' );
    3838                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
    39                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     39                $this->assertNotIXRError( $result );
    4040
    4141                // Check data types
    4242                $this->assertInternalType( 'string', $result['post_id'] );
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    7979        function test_no_fields() {
    8080                $fields = array();
    8181                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
    82                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     82                $this->assertNotIXRError( $result );
    8383
    8484                // when no fields are requested, only the IDs should be returned
    8585                $this->assertEquals( 1, count( $result ) );
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    8888
    8989        function test_default_fields() {
    9090                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id ) );
    91                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     91                $this->assertNotIXRError( $result );
    9292
    9393                $this->assertArrayHasKey( 'post_id', $result );
    9494                $this->assertArrayHasKey( 'link', $result ); // random field from 'posts' group
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    9999        function test_date() {
    100100                $fields = array( 'post' );
    101101                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
    102                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     102                $this->assertNotIXRError( $result );
    103103
    104104                $this->assertInstanceOf( 'IXR_Date', $result['post_date'] );
    105105                $this->assertInstanceOf( 'IXR_Date', $result['post_date_gmt'] );
    class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase { 
    130130                ) );
    131131
    132132                $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) );
    133                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     133                $this->assertNotIXRError( $result );
    134134
    135135                $this->assertInternalType( 'string', $result['post_id'] );
    136136                $this->assertInternalType( 'string', $result['post_parent'] );
  • tests/phpunit/tests/xmlrpc/wp/getPostType.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPostType.php tests/phpunit/tests/xmlrpc/wp/getPostType.php
    index a00dbda3f7..cef0fd6981 100644
    class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase { 
    3131
    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        }
    3737
    class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase { 
    3939                $this->make_user_by_role( 'editor' );
    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        }
    4545
    class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase { 
    4747                $this->make_user_by_role( 'editor' );
    4848
    4949                $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'post' ) );
    50                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     50                $this->assertNotIXRError( $result );
    5151        }
    5252
    5353        function test_incapable_user() {
    5454                $this->make_user_by_role( 'subscriber' );
    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        }
    6060
    class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase { 
    6262                $this->make_user_by_role( 'editor' );
    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
    6868                $this->assertInternalType( 'string', $result['name'] );
  • tests/phpunit/tests/xmlrpc/wp/getPostTypes.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPostTypes.php tests/phpunit/tests/xmlrpc/wp/getPostTypes.php
    index ae78a5db51..7188411931 100644
     
    66class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase {
    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        }
    1212
    class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase { 
    1414                $this->make_user_by_role( 'subscriber' );
    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 ) );
    2020        }
    class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase { 
    2323                $this->make_user_by_role( 'editor' );
    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 ) );
    2929        }
    class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase { 
    3232                $this->make_user_by_role( 'editor' );
    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
    3838                // verify that pages is in the result, and post is not
  • tests/phpunit/tests/xmlrpc/wp/getPosts.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getPosts.php tests/phpunit/tests/xmlrpc/wp/getPosts.php
    index 3119fea61f..28d3c4b28d 100644
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'username', 'password' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    1818                $this->make_user_by_role( 'subscriber' );
    1919
    2020                $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber' ) );
    21                 $this->assertInstanceOf( 'IXR_Error', $result );
     21                $this->assertIXRError( $result );
    2222                $this->assertEquals( 401, $result->code );
    2323
    2424                $filter = array( 'post_type' => 'page' );
    2525                $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber', $filter ) );
    26                 $this->assertInstanceOf( 'IXR_Error', $result );
     26                $this->assertIXRError( $result );
    2727                $this->assertEquals( 401, $result->code );
    2828        }
    2929
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    3131                $this->make_user_by_role( 'editor' );
    3232
    3333                $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
    34                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     34                $this->assertNotIXRError( $result );
    3535        }
    3636
    3737        function test_invalid_post_type() {
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    3939
    4040                $filter = array( 'post_type' => 'invalid_post_type_name' );
    4141                $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
    42                 $this->assertInstanceOf( 'IXR_Error', $result );
     42                $this->assertIXRError( $result );
    4343        }
    4444
    4545        function test_filters() {
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    6262                // get them all
    6363                $filter = array( 'post_type' => $cpt_name, 'number' => $num_posts + 10 );
    6464                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
    65                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     65                $this->assertNotIXRError( $results );
    6666                $this->assertEquals( $num_posts, count( $results ) );
    6767
    6868                // page through results
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    8686                // get results ordered by comment count
    8787                $filter2 = array( 'post_type' => $cpt_name, 'number' => $num_posts, 'orderby' => 'comment_count', 'order' => 'DESC' );
    8888                $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter2 ) );
    89                 $this->assertNotInstanceOf( 'IXR_Error', $results2 );
     89                $this->assertNotIXRError( $results2 );
    9090                $last_comment_count = 100;
    9191                foreach ( $results2 as $post ) {
    9292                        $comment_count = intval( get_comments_number( $post['post_id'] ) );
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    100100                wp_update_post( $post );
    101101                $filter3 = array( 'post_type' => $cpt_name, 'post_status' => 'draft' );
    102102                $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) );
    103                 $this->assertNotInstanceOf( 'IXR_Error', $results3 );
     103                $this->assertNotIXRError( $results3 );
    104104                $this->assertEquals( 1, count( $results3 ) );
    105105                $this->assertEquals( $post->ID, $results3[0]['post_id'] );
    106106
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    113113
    114114                // check default fields
    115115                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
    116                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     116                $this->assertNotIXRError( $results );
    117117                $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // subset of expected fields
    118118                foreach( $expected_fields as $field ) {
    119119                        $this->assertArrayHasKey( $field, $results[0] );
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    123123                $filter = array();
    124124                $fields = array( 'post_name', 'post_author', 'enclosure' );
    125125                $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter, $fields ) );
    126                 $this->assertNotInstanceOf( 'IXR_Error', $results2 );
     126                $this->assertNotIXRError( $results2 );
    127127                $expected_fields = array_merge( $fields, array( 'post_id' ) );
    128128                foreach ( array_keys( $results2[0] ) as $field ) {
    129129                        $this->assertContains( $field, $expected_fields );
    class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase { 
    142142                // Search for none of them
    143143                $filter = array( 's' => 'Third' );
    144144                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
    145                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     145                $this->assertNotIXRError( $results );
    146146                $this->assertEquals( 0, count( $results ) );
    147147
    148148                // Search for one of them
    149149                $filter = array( 's' => 'First:' );
    150150                $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
    151                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     151                $this->assertNotIXRError( $results );
    152152                $this->assertEquals( 1, count( $results ) );
    153153        }
    154154
  • tests/phpunit/tests/xmlrpc/wp/getProfile.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getProfile.php tests/phpunit/tests/xmlrpc/wp/getProfile.php
    index cc2da3e46a..86fd8213dd 100644
    class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase { 
    88
    99        function test_invalid_username_password() {
    1010                $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'username', 'password' ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $result );
     11                $this->assertIXRError( $result );
    1212                $this->assertEquals( 403, $result->code );
    1313        }
    1414
    class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase { 
    1616                $subscriber_id = $this->make_user_by_role( 'subscriber' );
    1717
    1818                $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'subscriber', 'subscriber' ) );
    19                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     19                $this->assertNotIXRError( $result );
    2020                $this->assertEquals( $subscriber_id, $result['user_id'] );
    2121                $this->assertContains( 'subscriber', $result['roles'] );
    2222        }
    class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase { 
    2525                $administrator_id = $this->make_user_by_role( 'administrator' );
    2626
    2727                $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'administrator', 'administrator' ) );
    28                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     28                $this->assertNotIXRError( $result );
    2929                $this->assertEquals( $administrator_id, $result['user_id'] );
    3030                $this->assertContains( 'administrator', $result['roles'] );
    3131        }
    class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase { 
    3636                $fields = array( 'email', 'bio', 'user_contacts' );
    3737
    3838                $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'editor', 'editor', $fields ) );
    39                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     39                $this->assertNotIXRError( $result );
    4040                $this->assertEquals( $editor_id, $result['user_id'] );
    4141
    4242                $expected_fields = array( 'user_id', 'email', 'bio' );
  • tests/phpunit/tests/xmlrpc/wp/getRevisions.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getRevisions.php tests/phpunit/tests/xmlrpc/wp/getRevisions.php
    index a407c65ae2..d1aad1e390 100644
    class Tests_XMLRPC_wp_getRevisions extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_getRevisions extends WP_XMLRPC_UnitTestCase { 
    1717                $post_id = self::factory()->post->create();
    1818
    1919                $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'subscriber', 'subscriber', $post_id ) );
    20                 $this->assertInstanceOf( 'IXR_Error', $result );
     20                $this->assertIXRError( $result );
    2121                $this->assertEquals( 401, $result->code );
    2222        }
    2323
    class Tests_XMLRPC_wp_getRevisions extends WP_XMLRPC_UnitTestCase { 
    2626
    2727                $post_id = self::factory()->post->create();
    2828                $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
    29                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     29                $this->assertNotIXRError( $result );
    3030        }
    3131
    3232        function test_revision_count() {
  • tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php
    index cd2c86e3cc..97bd9cf467 100644
    class Tests_XMLRPC_wp_getTaxonomies extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'username', 'password' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_getTaxonomies extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'editor' );
    1616
    1717                $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'editor', 'editor' ) );
    18                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     18                $this->assertNotIXRError( $result );
    1919        }
    2020}
     21 No newline at end of file
  • tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php
    index f8446bcbf9..5ffff80a81 100644
    class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password', 'category' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'editor' );
    1616
    1717                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', '' ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 403, $result->code );
    2020                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    2121        }
    class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { 
    2424                $this->make_user_by_role( 'editor' );
    2525
    2626                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'not_existing' ) );
    27                 $this->assertInstanceOf( 'IXR_Error', $result );
     27                $this->assertIXRError( $result );
    2828                $this->assertEquals( 403, $result->code );
    2929                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3030        }
    class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { 
    3333                $this->make_user_by_role( 'subscriber' );
    3434
    3535                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'category' ) );
    36                 $this->assertInstanceOf( 'IXR_Error', $result );
     36                $this->assertIXRError( $result );
    3737                $this->assertEquals( 401, $result->code );
    3838                $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
    3939        }
    class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { 
    4242                $this->make_user_by_role( 'editor' );
    4343
    4444                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
    45                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     45                $this->assertNotIXRError( $result );
    4646        }
    4747
    4848        function test_prepare_taxonomy() {
    4949                $this->make_user_by_role( 'editor' );
    5050
    5151                $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
    52                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     52                $this->assertNotIXRError( $result );
    5353                $taxonomy = get_taxonomy( 'category' );
    5454                $this->assertEquals( 'category', $result['name'], 'name' );
    5555                $this->assertEquals( true, $result['_builtin'], '_builtin' );
  • tests/phpunit/tests/xmlrpc/wp/getTerm.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getTerm.php tests/phpunit/tests/xmlrpc/wp/getTerm.php
    index 2edbaeb2ff..fca71a7a95 100644
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    1515
    1616        function test_invalid_username_password() {
    1717                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password', 'category', 1 ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 403, $result->code );
    2020        }
    2121
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    2323                $this->make_user_by_role( 'editor' );
    2424
    2525                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', '', 0 ) );
    26                 $this->assertInstanceOf( 'IXR_Error', $result );
     26                $this->assertIXRError( $result );
    2727                $this->assertEquals( 403, $result->code );
    2828                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    2929        }
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    3232                $this->make_user_by_role( 'editor' );
    3333
    3434                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'not_existing', 0 ) );
    35                 $this->assertInstanceOf( 'IXR_Error', $result );
     35                $this->assertIXRError( $result );
    3636                $this->assertEquals( 403, $result->code );
    3737                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3838        }
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    4141                $this->make_user_by_role( 'subscriber' );
    4242
    4343                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
    44                 $this->assertInstanceOf( 'IXR_Error', $result );
     44                $this->assertIXRError( $result );
    4545                $this->assertEquals( 401, $result->code );
    4646                $this->assertEquals( __( 'Sorry, you are not allowed to assign this term.' ), $result->message );
    4747        }
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    5151                $this->make_user_by_role( 'editor' );
    5252
    5353                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) );
    54                 $this->assertInstanceOf( 'IXR_Error', $result );
     54                $this->assertIXRError( $result );
    5555                $this->assertEquals( 500, $result->code );
    5656                $this->assertEquals( __('Empty Term'), $result->message );
    5757        }
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    6060                $this->make_user_by_role( 'editor' );
    6161
    6262                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
    63                 $this->assertInstanceOf( 'IXR_Error', $result );
     63                $this->assertIXRError( $result );
    6464                $this->assertEquals( 404, $result->code );
    6565                $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
    6666        }
    class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { 
    7272
    7373                $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) );
    7474
    75                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     75                $this->assertNotIXRError( $result );
    7676                $this->assertEquals( $result, $term );
    7777
    7878                // Check DataTypes
  • tests/phpunit/tests/xmlrpc/wp/getTerms.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getTerms.php tests/phpunit/tests/xmlrpc/wp/getTerms.php
    index 1673975f1f..b67cbde140 100644
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'editor' );
    1616
    1717                $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 403, $result->code );
    2020                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    2121        }
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    2424                $this->make_user_by_role( 'editor' );
    2525
    2626                $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) );
    27                 $this->assertInstanceOf( 'IXR_Error', $result );
     27                $this->assertIXRError( $result );
    2828                $this->assertEquals( 403, $result->code );
    2929                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3030        }
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    3333                $this->make_user_by_role( 'subscriber' );
    3434
    3535                $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) );
    36                 $this->assertInstanceOf( 'IXR_Error', $result );
     36                $this->assertIXRError( $result );
    3737                $this->assertEquals( 401, $result->code );
    3838                $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
    3939        }
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    4545                $cat = wp_insert_term( 'term_' . __FUNCTION__ , 'category' );
    4646
    4747                $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category' ) );
    48                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     48                $this->assertNotIXRError( $results );
    4949
    5050                foreach( $results as $term ) {
    5151                        $this->assertInternalType( 'int', $term['count'] );
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    7171
    7272                // test fetching all terms
    7373                $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name ) );
    74                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     74                $this->assertNotIXRError( $results );
    7575
    7676                $this->assertEquals( $num_terms, count( $results ) );
    7777                foreach ( $results as $term ) {
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    8181                // test paged results
    8282                $filter = array( 'number' => 5 );
    8383                $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
    84                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     84                $this->assertNotIXRError( $results );
    8585                $this->assertEquals( 5, count( $results2 ) );
    8686                $this->assertEquals( $results[1]['term_id'], $results2[1]['term_id'] ); // check one of the terms
    8787
    8888                $filter['offset'] = 10;
    8989                $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
    90                 $this->assertNotInstanceOf( 'IXR_Error', $results3 );
     90                $this->assertNotIXRError( $results3 );
    9191                $this->assertEquals( $num_terms - 10, count( $results3 ) );
    9292                $this->assertEquals( $results[11]['term_id'], $results3[1]['term_id'] );
    9393
    9494                // test hide_empty (since none have been attached to posts yet, all should be hidden
    9595                $filter = array( 'hide_empty' => true );
    9696                $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
    97                 $this->assertNotInstanceOf( 'IXR_Error', $results4 );
     97                $this->assertNotIXRError( $results4 );
    9898                $this->assertEquals( 0, count( $results4 ) );
    9999
    100100                unset($GLOBALS['wp_taxonomies'][$tax_name]);
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    111111
    112112                $filter = array( 'orderby' => 'count', 'order' => 'DESC' );
    113113                $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
    114                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     114                $this->assertNotIXRError( $results );
    115115                $this->assertNotEquals( 0, count( $results ) );
    116116
    117117                foreach( $results as $term ) {
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    133133                // search by full name
    134134                $filter = array( 'search' => $name );
    135135                $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
    136                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     136                $this->assertNotIXRError( $results );
    137137                $this->assertEquals( 1, count( $results ) );
    138138                $this->assertEquals( $name, $results[0]['name'] );
    139139                $this->assertEquals( $name_id, $results[0]['term_id'] );
    class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { 
    141141                // search by partial name
    142142                $filter = array( 'search' => substr( $name, 0, 10 ) );
    143143                $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
    144                 $this->assertNotInstanceOf( 'IXR_Error', $results2 );
     144                $this->assertNotIXRError( $results2 );
    145145                $this->assertEquals( 1, count( $results2 ) );
    146146                $this->assertEquals( $name, $results2[0]['name'] );
    147147                $this->assertEquals( $name_id, $results2[0]['term_id'] );
  • tests/phpunit/tests/xmlrpc/wp/getUser.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getUser.php tests/phpunit/tests/xmlrpc/wp/getUser.php
    index acef3c6a06..beda930f42 100644
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    2525
    2626        function test_invalid_username_password() {
    2727                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) );
    28                 $this->assertInstanceOf( 'IXR_Error', $result );
     28                $this->assertIXRError( $result );
    2929                $this->assertEquals( 403, $result->code );
    3030        }
    3131
    3232        function test_invalid_user() {
    3333                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', 34902348908234 ) );
    34                 $this->assertInstanceOf( 'IXR_Error', $result );
     34                $this->assertIXRError( $result );
    3535                $this->assertEquals( 404, $result->code );
    3636        }
    3737
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    4040                $editor_id = $this->make_user_by_role( 'editor' );
    4141
    4242                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $editor_id ) );
    43                 $this->assertInstanceOf( 'IXR_Error', $result );
     43                $this->assertIXRError( $result );
    4444                $this->assertEquals( 401, $result->code );
    4545        }
    4646
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    4848                $subscriber_id = $this->make_user_by_role( 'subscriber' );
    4949
    5050                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $subscriber_id ) );
    51                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     51                $this->assertNotIXRError( $result );
    5252                $this->assertEquals( $subscriber_id, $result['user_id'] );
    5353        }
    5454
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    7272                $user_id = wp_insert_user( $user_data );
    7373
    7474                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $user_id ) );
    75                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     75                $this->assertNotIXRError( $result );
    7676
    7777                // check data types
    7878                $this->assertInternalType( 'string', $result['user_id'] );
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    111111                $editor_id = $this->make_user_by_role( 'editor' );
    112112
    113113                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array() ) );
    114                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     114                $this->assertNotIXRError( $result );
    115115                $this->assertEquals( $editor_id, $result['user_id'] );
    116116
    117117                $expected_fields = array( 'user_id' );
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    122122                $editor_id = $this->make_user_by_role( 'editor' );
    123123
    124124                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array( 'basic' ) ) );
    125                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     125                $this->assertNotIXRError( $result );
    126126                $this->assertEquals( $editor_id, $result['user_id'] );
    127127
    128128                $expected_fields = array( 'user_id', 'username', 'email', 'registered', 'display_name', 'nicename' );
    class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { 
    138138                $fields = array( 'email', 'bio', 'user_contacts' );
    139139
    140140                $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, $fields ) );
    141                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     141                $this->assertNotIXRError( $result );
    142142                $this->assertEquals( $editor_id, $result['user_id'] );
    143143
    144144                $expected_fields = array( 'user_id', 'email', 'bio' );
  • tests/phpunit/tests/xmlrpc/wp/getUsers.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getUsers.php tests/phpunit/tests/xmlrpc/wp/getUsers.php
    index 1860fd11d3..62169e0c64 100644
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    88
    99        function test_invalid_username_password() {
    1010                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'username', 'password' ) );
    11                 $this->assertInstanceOf( 'IXR_Error', $results );
     11                $this->assertIXRError( $results );
    1212                $this->assertEquals( 403, $results->code );
    1313        }
    1414
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    1616                $this->make_user_by_role( 'subscriber' );
    1717
    1818                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'subscriber', 'subscriber' ) );
    19                 $this->assertInstanceOf( 'IXR_Error', $results );
     19                $this->assertIXRError( $results );
    2020                $this->assertEquals( 401, $results->code );
    2121        }
    2222
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    2424                $this->make_user_by_role( 'administrator' );
    2525
    2626                $result = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator' ) );
    27                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     27                $this->assertNotIXRError( $result );
    2828
    2929                // check data types
    3030                $this->assertInternalType( 'string', $result[0]['user_id'] );
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    4949
    5050                $filter = array( 'role' => 'invalidrole' );
    5151                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    52                 $this->assertInstanceOf( 'IXR_Error', $results );
     52                $this->assertIXRError( $results );
    5353                $this->assertEquals( 403, $results->code );
    5454        }
    5555
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    6363                // test a single role ('editor')
    6464                $filter = array( 'role' => 'editor' );
    6565                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    66                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     66                $this->assertNotIXRError( $results );
    6767                $this->assertCount( 1, $results );
    6868                $this->assertEquals( $editor_id, $results[0]['user_id'] );
    6969
    7070                // test 'authors', which should return all non-subscribers
    7171                $filter2 = array( 'who' => 'authors' );
    7272                $results2 = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter2 ) );
    73                 $this->assertNotInstanceOf( 'IXR_Error', $results2 );
     73                $this->assertNotIXRError( $results2 );
    7474                $this->assertCount( 3, array_intersect( array( $author_id, $editor_id, $administrator_id ), wp_list_pluck( $results2, 'user_id' ) ) );
    7575        }
    7676
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    104104
    105105                $filter = array( 'orderby' => 'email', 'order' => 'ASC' );
    106106                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    107                 $this->assertNotInstanceOf( 'IXR_Error', $results );
     107                $this->assertNotIXRError( $results );
    108108
    109109                $last_email = '';
    110110                foreach ( $results as $user ) {
  • tests/phpunit/tests/xmlrpc/wp/newComment.php

    diff --git tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/newComment.php
    index 80e70ef32e..148c6acc23 100644
    class Tests_XMLRPC_wp_newComment extends WP_XMLRPC_UnitTestCase { 
    1313                        'content' => rand_str( 100 )
    1414                ) ) );
    1515 
    16                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     16                $this->assertNotIXRError( $result );
    1717        }
    1818 
    1919        function test_empty_comment() {
    class Tests_XMLRPC_wp_newComment extends WP_XMLRPC_UnitTestCase { 
    2424                        'content' => ''
    2525                ) ) );
    2626 
    27                 $this->assertInstanceOf( 'IXR_Error', $result );
     27                $this->assertIXRError( $result );
    2828                $this->assertEquals( 403, $result->code );
    2929        }
    3030
    class Tests_XMLRPC_wp_newComment extends WP_XMLRPC_UnitTestCase { 
    4040                        'content' => rand_str( 100 ),
    4141                ) ) );
    4242
    43                 $this->assertInstanceOf( 'IXR_Error', $result );
     43                $this->assertIXRError( $result );
    4444                $this->assertEquals( 403, $result->code );
    4545        }
    4646
    class Tests_XMLRPC_wp_newComment extends WP_XMLRPC_UnitTestCase { 
    5454
    5555                // First time it's a valid comment
    5656                $result = $this->myxmlrpcserver->wp_newComment( $comment_args  );
    57                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     57                $this->assertNotIXRError( $result );
    5858
    5959                // Run second time for duplication error
    6060                $result = $this->myxmlrpcserver->wp_newComment( $comment_args );
    6161
    62                 $this->assertInstanceOf( 'IXR_Error', $result );
     62                $this->assertIXRError( $result );
    6363                $this->assertEquals( 403, $result->code );
    6464        }
    6565
  • tests/phpunit/tests/xmlrpc/wp/newPost.php

    diff --git tests/phpunit/tests/xmlrpc/wp/newPost.php tests/phpunit/tests/xmlrpc/wp/newPost.php
    index 3092aef637..1b718bc563 100644
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    77
    88        function test_invalid_username_password() {
    99                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) );
    10                 $this->assertInstanceOf( 'IXR_Error', $result );
     10                $this->assertIXRError( $result );
    1111                $this->assertEquals( 403, $result->code );
    1212        }
    1313
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    1515                $this->make_user_by_role( 'subscriber' );
    1616
    1717                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 401, $result->code );
    2020        }
    2121
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    2323                $this->make_user_by_role( 'author' );
    2424
    2525                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) );
    26                 $this->assertInstanceOf( 'IXR_Error', $result );
     26                $this->assertIXRError( $result );
    2727                $this->assertEquals( 500, $result->code );
    2828                $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
    2929        }
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    3333
    3434                $post = array( 'post_title' => 'Test' );
    3535                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    36                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     36                $this->assertNotIXRError( $result );
    3737                $this->assertStringMatchesFormat( '%d', $result );
    3838        }
    3939
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    4242
    4343                $post = array( 'post_title' => 'Test', 'ID' => 103948 );
    4444                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    45                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     45                $this->assertNotIXRError( $result );
    4646                $this->assertNotEquals( '103948', $result );
    4747        }
    4848
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    5151
    5252                $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
    5353                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    54                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     54                $this->assertNotIXRError( $result );
    5555        }
    5656
    5757        function test_incapable_publish() {
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    5959
    6060                $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
    6161                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
    62                 $this->assertInstanceOf( 'IXR_Error', $result );
     62                $this->assertIXRError( $result );
    6363                $this->assertEquals( 401, $result->code );
    6464        }
    6565
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    6868
    6969                $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
    7070                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    71                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     71                $this->assertNotIXRError( $result );
    7272        }
    7373
    7474        function test_incapable_private() {
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    7676
    7777                $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
    7878                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
    79                 $this->assertInstanceOf( 'IXR_Error', $result );
     79                $this->assertIXRError( $result );
    8080                $this->assertEquals( 401, $result->code );
    8181        }
    8282
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    8686
    8787                $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
    8888                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    89                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     89                $this->assertNotIXRError( $result );
    9090        }
    9191
    9292        function test_incapable_other_author() {
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    9595
    9696                $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
    9797                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
    98                 $this->assertInstanceOf( 'IXR_Error', $result );
     98                $this->assertIXRError( $result );
    9999                $this->assertEquals( 401, $result->code );
    100100        }
    101101
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    104104
    105105                $post = array( 'post_title' => 'Test', 'post_author' => 99999999 );
    106106                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    107                 $this->assertInstanceOf( 'IXR_Error', $result );
     107                $this->assertIXRError( $result );
    108108                $this->assertEquals( 404, $result->code );
    109109        }
    110110
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    113113
    114114                $post = array( 'post_title' => 'Test' );
    115115                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    116                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     116                $this->assertNotIXRError( $result );
    117117                $this->assertStringMatchesFormat( '%d', $result );
    118118
    119119                $out = get_post( $result );
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    132132
    133133                $post = array( 'post_title' => 'Post Thumbnail Test', 'post_thumbnail' => $attachment_id );
    134134                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    135                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     135                $this->assertNotIXRError( $result );
    136136                $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
    137137
    138138                remove_theme_support( 'post-thumbnails' );
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    143143
    144144                $post = array( 'post_title' => 'Test', 'post_status' => 'foobar_status' );
    145145                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
    146                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     146                $this->assertNotIXRError( $result );
    147147                $this->assertEquals( 'draft', get_post_status( $result ) );
    148148        }
    149149
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    152152
    153153                $post = array( 'post_title' => 'Test', 'sticky' => true );
    154154                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
    155                 $this->assertInstanceOf( 'IXR_Error', $result );
     155                $this->assertIXRError( $result );
    156156                $this->assertEquals( 401, $result->code );
    157157        }
    158158
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    161161
    162162                $post = array( 'post_title' => 'Test', 'sticky' => true );
    163163                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    164                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     164                $this->assertNotIXRError( $result );
    165165                $this->assertTrue( is_sticky( $result ) );
    166166        }
    167167
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    170170
    171171                $post = array( 'post_title' => 'Test', 'post_status' => 'private', 'sticky' => true );
    172172                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    173                 $this->assertInstanceOf( 'IXR_Error', $result );
     173                $this->assertIXRError( $result );
    174174                $this->assertEquals( 401, $result->code );
    175175        }
    176176
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    179179
    180180                $post = array( 'post_title' => 'Test', 'post_format' => 'quote' );
    181181                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    182                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     182                $this->assertNotIXRError( $result );
    183183                $this->assertEquals( 'quote', get_post_format( $result ) );
    184184        }
    185185
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    188188
    189189                $post = array( 'post_title' => 'Test', 'post_format' => 'tumblr' );
    190190                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    191                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     191                $this->assertNotIXRError( $result );
    192192                $this->assertEquals( '', get_post_format( $result ) );
    193193        }
    194194
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    202202                        )
    203203                );
    204204                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    205                 $this->assertInstanceOf( 'IXR_Error', $result );
     205                $this->assertIXRError( $result );
    206206                $this->assertEquals( 401, $result->code );
    207207
    208208                $post2 = array(
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    212212                        )
    213213                );
    214214                $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
    215                 $this->assertInstanceOf( 'IXR_Error', $result2 );
     215                $this->assertIXRError( $result2 );
    216216                $this->assertEquals( 401, $result2->code );
    217217        }
    218218
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    226226                        )
    227227                );
    228228                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    229                 $this->assertInstanceOf( 'IXR_Error', $result );
     229                $this->assertIXRError( $result );
    230230                $this->assertEquals( 403, $result->code );
    231231        }
    232232
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    247247                        )
    248248                );
    249249                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    250                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     250                $this->assertNotIXRError( $result );
    251251
    252252                $post_tags = wp_get_object_terms( $result, 'post_tag', array( 'fields' => 'ids' ) );
    253253                $this->assertNotContains( $tag1['term_id'], $post_tags );
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    274274                        )
    275275                );
    276276                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
    277                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     277                $this->assertNotIXRError( $result );
    278278                // verify that cat2 was created
    279279                $cat2 = get_term_by( 'name', $cat2_name, 'category' );
    280280                $this->assertNotEmpty( $cat2 );
    class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase { 
    291291                        )
    292292                );
    293293                $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
    294                 $this->assertInstanceOf( 'IXR_Error', $result2 );
     294                $this->assertIXRError( $result2 );
    295295                $this->assertEquals( 401, $result2->code );
    296296        }
    297297
  • tests/phpunit/tests/xmlrpc/wp/newTerm.php

    diff --git tests/phpunit/tests/xmlrpc/wp/newTerm.php tests/phpunit/tests/xmlrpc/wp/newTerm.php
    index 860e5c8dcb..f5f012f3eb 100644
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    1515
    1616        function test_invalid_username_password() {
    1717                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
    18                 $this->assertInstanceOf( 'IXR_Error', $result );
     18                $this->assertIXRError( $result );
    1919                $this->assertEquals( 403, $result->code );
    2020        }
    2121
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    2323                $this->make_user_by_role( 'editor' );
    2424
    2525                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) );
    26                 $this->assertInstanceOf( 'IXR_Error', $result );
     26                $this->assertIXRError( $result );
    2727                $this->assertEquals( 403, $result->code );
    2828                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    2929        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    3232                $this->make_user_by_role( 'editor' );
    3333
    3434                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) );
    35                 $this->assertInstanceOf( 'IXR_Error', $result );
     35                $this->assertIXRError( $result );
    3636                $this->assertEquals( 403, $result->code );
    3737                $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
    3838        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    4141                $this->make_user_by_role( 'subscriber' );
    4242
    4343                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) );
    44                 $this->assertInstanceOf( 'IXR_Error', $result );
     44                $this->assertIXRError( $result );
    4545                $this->assertEquals( 401, $result->code );
    4646                $this->assertEquals( __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), $result->message );
    4747        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    5050                $this->make_user_by_role( 'editor' );
    5151
    5252                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) );
    53                 $this->assertInstanceOf( 'IXR_Error', $result );
     53                $this->assertIXRError( $result );
    5454                $this->assertEquals( 403, $result->code );
    5555                $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
    5656        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    5959                $this->make_user_by_role( 'editor' );
    6060
    6161                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) );
    62                 $this->assertInstanceOf( 'IXR_Error', $result );
     62                $this->assertIXRError( $result );
    6363                $this->assertEquals( 403, $result->code );
    6464                $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
    6565        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    6868                $this->make_user_by_role( 'editor' );
    6969
    7070                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
    71                 $this->assertInstanceOf( 'IXR_Error', $result );
     71                $this->assertIXRError( $result );
    7272                $this->assertEquals( 500, $result->code );
    7373        }
    7474
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    7676                $this->make_user_by_role( 'editor' );
    7777
    7878                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
    79                 $this->assertInstanceOf( 'IXR_Error', $result );
     79                $this->assertIXRError( $result );
    8080                $this->assertEquals( 403, $result->code );
    8181                $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
    8282        }
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    8686                $this->make_user_by_role( 'editor' );
    8787
    8888                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) );
    89                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     89                $this->assertNotIXRError( $result );
    9090                $this->assertStringMatchesFormat( '%d', $result );
    9191        }
    9292
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    9494                $this->make_user_by_role( 'editor' );
    9595
    9696                $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) );
    97                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     97                $this->assertNotIXRError( $result );
    9898                $this->assertStringMatchesFormat( '%d', $result );
    9999        }
    100100
    class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { 
    103103
    104104                $taxonomy = array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
    105105                $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) );
    106                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     106                $this->assertNotIXRError( $result );
    107107                $this->assertStringMatchesFormat( '%d', $result );
    108108        }
    109109}
  • tests/phpunit/tests/xmlrpc/wp/restoreRevision.php

    diff --git tests/phpunit/tests/xmlrpc/wp/restoreRevision.php tests/phpunit/tests/xmlrpc/wp/restoreRevision.php
    index 75f5d74fa0..be9d1916af 100644
    class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase { 
    2323
    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        }
    2929
    class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase { 
    3131                $this->make_user_by_role( 'subscriber' );
    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        }
    3737
    class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase { 
    3939                $this->make_user_by_role( 'editor' );
    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
    4545        function test_revision_restored() {
  • tests/phpunit/tests/xmlrpc/wp/uploadFile.php

    diff --git tests/phpunit/tests/xmlrpc/wp/uploadFile.php tests/phpunit/tests/xmlrpc/wp/uploadFile.php
    index 8baa3f6cff..e15f85d420 100644
    class Tests_XMLRPC_wp_uploadFile extends WP_XMLRPC_UnitTestCase { 
    2525
    2626
    2727                $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
    28                 $this->assertNotInstanceOf( 'IXR_Error', $result );
     28                $this->assertNotIXRError( $result );
    2929
    3030                // check data types
    3131                $this->assertInternalType( 'string', $result['id'] );