Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php
- Timestamp:
- 04/12/2017 02:58:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php
r38382 r40417 8 8 function test_invalid_username_password() { 9 9 $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'username', 'password' ) ); 10 $this->assertI nstanceOf( 'IXR_Error',$result );10 $this->assertIXRError( $result ); 11 11 $this->assertEquals( 403, $result->code ); 12 12 } … … 19 19 20 20 $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber' ) ); 21 $this->assertI nstanceOf( 'IXR_Error',$result );21 $this->assertIXRError( $result ); 22 22 $this->assertEquals( 401, $result->code ); 23 23 24 24 $filter = array( 'post_type' => 'page' ); 25 25 $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber', $filter ) ); 26 $this->assertI nstanceOf( 'IXR_Error',$result );26 $this->assertIXRError( $result ); 27 27 $this->assertEquals( 401, $result->code ); 28 28 } … … 32 32 33 33 $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) ); 34 $this->assertNotI nstanceOf( 'IXR_Error',$result );34 $this->assertNotIXRError( $result ); 35 35 } 36 36 … … 40 40 $filter = array( 'post_type' => 'invalid_post_type_name' ); 41 41 $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 42 $this->assertI nstanceOf( 'IXR_Error',$result );42 $this->assertIXRError( $result ); 43 43 } 44 44 … … 63 63 $filter = array( 'post_type' => $cpt_name, 'number' => $num_posts + 10 ); 64 64 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 65 $this->assertNotI nstanceOf( 'IXR_Error',$results );65 $this->assertNotIXRError( $results ); 66 66 $this->assertEquals( $num_posts, count( $results ) ); 67 67 … … 87 87 $filter2 = array( 'post_type' => $cpt_name, 'number' => $num_posts, 'orderby' => 'comment_count', 'order' => 'DESC' ); 88 88 $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter2 ) ); 89 $this->assertNotI nstanceOf( 'IXR_Error',$results2 );89 $this->assertNotIXRError( $results2 ); 90 90 $last_comment_count = 100; 91 91 foreach ( $results2 as $post ) { … … 101 101 $filter3 = array( 'post_type' => $cpt_name, 'post_status' => 'draft' ); 102 102 $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) ); 103 $this->assertNotI nstanceOf( 'IXR_Error',$results3 );103 $this->assertNotIXRError( $results3 ); 104 104 $this->assertEquals( 1, count( $results3 ) ); 105 105 $this->assertEquals( $post->ID, $results3[0]['post_id'] ); … … 114 114 // check default fields 115 115 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) ); 116 $this->assertNotI nstanceOf( 'IXR_Error',$results );116 $this->assertNotIXRError( $results ); 117 117 $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // subset of expected fields 118 118 foreach( $expected_fields as $field ) { … … 124 124 $fields = array( 'post_name', 'post_author', 'enclosure' ); 125 125 $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter, $fields ) ); 126 $this->assertNotI nstanceOf( 'IXR_Error',$results2 );126 $this->assertNotIXRError( $results2 ); 127 127 $expected_fields = array_merge( $fields, array( 'post_id' ) ); 128 128 foreach ( array_keys( $results2[0] ) as $field ) { … … 143 143 $filter = array( 's' => 'Third' ); 144 144 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 145 $this->assertNotI nstanceOf( 'IXR_Error',$results );145 $this->assertNotIXRError( $results ); 146 146 $this->assertEquals( 0, count( $results ) ); 147 147 … … 149 149 $filter = array( 's' => 'First:' ); 150 150 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 151 $this->assertNotI nstanceOf( 'IXR_Error',$results );151 $this->assertNotIXRError( $results ); 152 152 $this->assertEquals( 1, count( $results ) ); 153 153 }
Note: See TracChangeset
for help on using the changeset viewer.