Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
- Timestamp:
- 04/12/2017 02:58:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
r38938 r40417 8 8 function test_invalid_username_password() { 9 9 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) ); 10 $this->assertI nstanceOf( 'IXR_Error',$result );10 $this->assertIXRError( $result ); 11 11 $this->assertEquals( 403, $result->code ); 12 12 } … … 16 16 17 17 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) ); 18 $this->assertI nstanceOf( 'IXR_Error',$result );18 $this->assertIXRError( $result ); 19 19 $this->assertEquals( 403, $result->code ); 20 20 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 25 25 26 26 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) ); 27 $this->assertI nstanceOf( 'IXR_Error',$result );27 $this->assertIXRError( $result ); 28 28 $this->assertEquals( 403, $result->code ); 29 29 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 34 34 35 35 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) ); 36 $this->assertI nstanceOf( 'IXR_Error',$result );36 $this->assertIXRError( $result ); 37 37 $this->assertEquals( 401, $result->code ); 38 38 $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message ); … … 46 46 47 47 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category' ) ); 48 $this->assertNotI nstanceOf( 'IXR_Error',$results );48 $this->assertNotIXRError( $results ); 49 49 50 50 foreach( $results as $term ) { … … 72 72 // test fetching all terms 73 73 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name ) ); 74 $this->assertNotI nstanceOf( 'IXR_Error',$results );74 $this->assertNotIXRError( $results ); 75 75 76 76 $this->assertEquals( $num_terms, count( $results ) ); … … 82 82 $filter = array( 'number' => 5 ); 83 83 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 84 $this->assertNotI nstanceOf( 'IXR_Error',$results );84 $this->assertNotIXRError( $results ); 85 85 $this->assertEquals( 5, count( $results2 ) ); 86 86 $this->assertEquals( $results[1]['term_id'], $results2[1]['term_id'] ); // check one of the terms … … 88 88 $filter['offset'] = 10; 89 89 $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 90 $this->assertNotI nstanceOf( 'IXR_Error',$results3 );90 $this->assertNotIXRError( $results3 ); 91 91 $this->assertEquals( $num_terms - 10, count( $results3 ) ); 92 92 $this->assertEquals( $results[11]['term_id'], $results3[1]['term_id'] ); … … 95 95 $filter = array( 'hide_empty' => true ); 96 96 $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 97 $this->assertNotI nstanceOf( 'IXR_Error',$results4 );97 $this->assertNotIXRError( $results4 ); 98 98 $this->assertEquals( 0, count( $results4 ) ); 99 99 … … 112 112 $filter = array( 'orderby' => 'count', 'order' => 'DESC' ); 113 113 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 114 $this->assertNotI nstanceOf( 'IXR_Error',$results );114 $this->assertNotIXRError( $results ); 115 115 $this->assertNotEquals( 0, count( $results ) ); 116 116 … … 134 134 $filter = array( 'search' => $name ); 135 135 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 136 $this->assertNotI nstanceOf( 'IXR_Error',$results );136 $this->assertNotIXRError( $results ); 137 137 $this->assertEquals( 1, count( $results ) ); 138 138 $this->assertEquals( $name, $results[0]['name'] ); … … 142 142 $filter = array( 'search' => substr( $name, 0, 10 ) ); 143 143 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 144 $this->assertNotI nstanceOf( 'IXR_Error',$results2 );144 $this->assertNotIXRError( $results2 ); 145 145 $this->assertEquals( 1, count( $results2 ) ); 146 146 $this->assertEquals( $name, $results2[0]['name'] );
Note: See TracChangeset
for help on using the changeset viewer.