Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/mw/editPost.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/editPost.php
r37044 r40417 9 9 $post = array(); 10 10 $result = $this->myxmlrpcserver->mw_editPost( 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 } … … 21 21 $post2 = array( 'title' => $new_title ); 22 22 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 23 $this->assertNotI nstanceOf( 'IXR_Error',$result );23 $this->assertNotIXRError( $result ); 24 24 $this->assertTrue($result); 25 25 … … 38 38 $post2 = array( 'title' => $new_title ); 39 39 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) ); 40 $this->assertNotI nstanceOf( 'IXR_Error',$result );40 $this->assertNotIXRError( $result ); 41 41 $this->assertTrue($result); 42 42 … … 56 56 $post2 = array( 'title' => $new_title ); 57 57 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 58 $this->assertI nstanceOf( 'IXR_Error',$result );58 $this->assertIXRError( $result ); 59 59 $this->assertEquals( 401, $result->code ); 60 60 … … 73 73 $post2 = array( 'wp_author_id' => $author_id ); 74 74 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) ); 75 $this->assertNotI nstanceOf( 'IXR_Error',$result );75 $this->assertNotIXRError( $result ); 76 76 $this->assertTrue($result); 77 77 … … 89 89 $post2 = array( 'wp_author_id' => $author_id ); 90 90 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 91 $this->assertI nstanceOf( 'IXR_Error',$result );91 $this->assertIXRError( $result ); 92 92 $this->assertEquals( 401, $result->code ); 93 93 … … 108 108 $post2 = array( 'wp_author_id' => $editor_id ); 109 109 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) ); 110 $this->assertNotI nstanceOf( 'IXR_Error',$result );110 $this->assertNotIXRError( $result ); 111 111 $this->assertTrue($result); 112 112 … … 132 132 $post2 = array( 'wp_post_thumbnail' => $attachment_id ); 133 133 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post2 ) ); 134 $this->assertNotI nstanceOf( 'IXR_Error',$result );134 $this->assertNotIXRError( $result ); 135 135 $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 136 136 … … 138 138 $post3 = array( 'post_content' => 'Updated post' ); 139 139 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post3 ) ); 140 $this->assertNotI nstanceOf( 'IXR_Error',$result );140 $this->assertNotIXRError( $result ); 141 141 $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 142 142 … … 147 147 $post4 = array( 'wp_post_thumbnail' => $attachment2_id ); 148 148 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post4 ) ); 149 $this->assertNotI nstanceOf( 'IXR_Error',$result );149 $this->assertNotIXRError( $result ); 150 150 $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 151 151 … … 153 153 $post5 = array( 'wp_post_thumbnail' => '' ); 154 154 $result = $this->myxmlrpcserver->mw_editPost( array($post_id, 'author', 'author', $post5 ) ); 155 $this->assertNotI nstanceOf( 'IXR_Error',$result );155 $this->assertNotIXRError( $result ); 156 156 $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) ); 157 157 … … 167 167 $post2 = array( 'title' => 'New Title', 'post_author' => $contributor_id ); 168 168 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 169 $this->assertNotI nstanceOf( 'IXR_Error',$result );169 $this->assertNotIXRError( $result ); 170 170 $this->assertTrue($result); 171 171 … … 175 175 $post3 = array( 'description' => 'New Content', 'post_author' => $contributor_id ); 176 176 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post3 ) ); 177 $this->assertNotI nstanceOf( 'IXR_Error',$result );177 $this->assertNotIXRError( $result ); 178 178 $this->assertTrue($result); 179 179 … … 184 184 $post4 = array( 'mt_excerpt' => 'New Excerpt', 'post_author' => $contributor_id ); 185 185 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post4 ) ); 186 $this->assertNotI nstanceOf( 'IXR_Error',$result );186 $this->assertNotIXRError( $result ); 187 187 $this->assertTrue($result); 188 188 … … 203 203 204 204 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array( 'sticky' => '1' ) ) ); 205 $this->assertNotI nstanceOf( 'IXR_Error',$result );205 $this->assertNotIXRError( $result ); 206 206 $this->assertTrue( $result ); 207 207 } … … 216 216 $post2 = array( 'post_type' => 'page' ); 217 217 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 218 $this->assertI nstanceOf( 'IXR_Error',$result );218 $this->assertIXRError( $result ); 219 219 $this->assertEquals( $result->code, 401 ); 220 220 }
Note: See TracChangeset
for help on using the changeset viewer.