Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
- Timestamp:
- 04/12/2017 02:58:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php
r36163 r40417 9 9 $post = array(); 10 10 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) ); 11 $this->assertI nstanceOf( 'IXR_Error',$result );11 $this->assertIXRError( $result ); 12 12 $this->assertEquals( 403, $result->code ); 13 13 } … … 18 18 $post = array(); 19 19 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) ); 20 $this->assertI nstanceOf( 'IXR_Error',$result );20 $this->assertIXRError( $result ); 21 21 $this->assertEquals( 401, $result->code ); 22 22 } … … 27 27 $post = array(); 28 28 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 29 $this->assertI nstanceOf( 'IXR_Error',$result );29 $this->assertIXRError( $result ); 30 30 $this->assertEquals( 500, $result->code ); 31 31 $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message ); … … 37 37 $post = array( 'title' => 'Test' ); 38 38 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 39 $this->assertNotI nstanceOf( 'IXR_Error',$result );39 $this->assertNotIXRError( $result ); 40 40 $this->assertStringMatchesFormat( '%d', $result ); 41 41 } … … 46 46 $post = array( 'title' => 'Test', 'ID' => 103948 ); 47 47 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 48 $this->assertNotI nstanceOf( 'IXR_Error',$result );48 $this->assertNotIXRError( $result ); 49 49 $this->assertNotEquals( '103948', $result ); 50 50 } … … 55 55 $post = array( 'title' => 'Test', 'post_status' => 'publish' ); 56 56 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 57 $this->assertNotI nstanceOf( 'IXR_Error',$result );57 $this->assertNotIXRError( $result ); 58 58 } 59 59 … … 63 63 $post = array( 'title' => 'Test', 'post_status' => 'publish' ); 64 64 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) ); 65 $this->assertI nstanceOf( 'IXR_Error',$result );65 $this->assertIXRError( $result ); 66 66 $this->assertEquals( 401, $result->code ); 67 67 } … … 73 73 $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id ); 74 74 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 75 $this->assertNotI nstanceOf( 'IXR_Error',$result );75 $this->assertNotIXRError( $result ); 76 76 } 77 77 … … 82 82 $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id ); 83 83 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) ); 84 $this->assertI nstanceOf( 'IXR_Error',$result );84 $this->assertIXRError( $result ); 85 85 $this->assertEquals( 401, $result->code ); 86 86 } … … 94 94 $post = array( 'title' => 'Test', 'wp_author_id' => 99999999 ); 95 95 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 96 $this->assertI nstanceOf( 'IXR_Error',$result );96 $this->assertIXRError( $result ); 97 97 $this->assertEquals( 404, $result->code ); 98 98 } … … 103 103 $post = array( 'title' => 'Test' ); 104 104 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 105 $this->assertNotI nstanceOf( 'IXR_Error',$result );105 $this->assertNotIXRError( $result ); 106 106 $this->assertStringMatchesFormat( '%d', $result ); 107 107 … … 122 122 $post = array( 'title' => 'Post Thumbnail Test', 'wp_post_thumbnail' => $attachment_id ); 123 123 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 124 $this->assertNotI nstanceOf( 'IXR_Error',$result );124 $this->assertNotIXRError( $result ); 125 125 $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) ); 126 126 … … 133 133 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 134 134 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) ); 135 $this->assertI nstanceOf( 'IXR_Error',$result );135 $this->assertIXRError( $result ); 136 136 $this->assertEquals( 401, $result->code ); 137 137 } … … 142 142 $post = array( 'title' => 'Test', 'post_type' => 'page' ); 143 143 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 144 $this->assertNotI nstanceOf( 'IXR_Error',$result );144 $this->assertNotIXRError( $result ); 145 145 $this->assertStringMatchesFormat( '%d', $result ); 146 146 … … 163 163 ); 164 164 $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) ); 165 $this->assertNotI nstanceOf( 'IXR_Error',$result );165 $this->assertNotIXRError( $result ); 166 166 $this->assertStringMatchesFormat( '%d', $result ); 167 167
Note: See TracChangeset
for help on using the changeset viewer.