Changeset 48937 for trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
r47122 r48937 9 9 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) ); 10 10 $this->assertIXRError( $result ); 11 $this->assert Equals( 403, $result->code );11 $this->assertSame( 403, $result->code ); 12 12 } 13 13 … … 17 17 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) ); 18 18 $this->assertIXRError( $result ); 19 $this->assert Equals( 403, $result->code );20 $this->assert Equals( __( 'Invalid taxonomy.' ), $result->message );19 $this->assertSame( 403, $result->code ); 20 $this->assertSame( __( 'Invalid taxonomy.' ), $result->message ); 21 21 } 22 22 … … 26 26 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) ); 27 27 $this->assertIXRError( $result ); 28 $this->assert Equals( 403, $result->code );29 $this->assert Equals( __( 'Invalid taxonomy.' ), $result->message );28 $this->assertSame( 403, $result->code ); 29 $this->assertSame( __( 'Invalid taxonomy.' ), $result->message ); 30 30 } 31 31 … … 35 35 $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) ); 36 36 $this->assertIXRError( $result ); 37 $this->assert Equals( 401, $result->code );38 $this->assert Equals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );37 $this->assertSame( 401, $result->code ); 38 $this->assertSame( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message ); 39 39 } 40 40 … … 78 78 $this->assertNotIXRError( $results ); 79 79 80 $this->assert Equals( $num_terms, count( $results ) );80 $this->assertSame( $num_terms, count( $results ) ); 81 81 foreach ( $results as $term ) { 82 $this->assert Equals( $tax_name, $term['taxonomy'] );82 $this->assertSame( $tax_name, $term['taxonomy'] ); 83 83 } 84 84 … … 87 87 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 88 88 $this->assertNotIXRError( $results ); 89 $this->assert Equals( 5, count( $results2 ) );90 $this->assert Equals( $results[1]['term_id'], $results2[1]['term_id'] ); // Check one of the terms.89 $this->assertSame( 5, count( $results2 ) ); 90 $this->assertSame( $results[1]['term_id'], $results2[1]['term_id'] ); // Check one of the terms. 91 91 92 92 $filter['offset'] = 10; 93 93 $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 94 94 $this->assertNotIXRError( $results3 ); 95 $this->assert Equals( $num_terms - 10, count( $results3 ) );96 $this->assert Equals( $results[11]['term_id'], $results3[1]['term_id'] );95 $this->assertSame( $num_terms - 10, count( $results3 ) ); 96 $this->assertSame( $results[11]['term_id'], $results3[1]['term_id'] ); 97 97 98 98 // Test hide_empty (since none have been attached to posts yet, all should be hidden. … … 100 100 $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 101 101 $this->assertNotIXRError( $results4 ); 102 $this->assert Equals( 0, count( $results4 ) );102 $this->assertSame( 0, count( $results4 ) ); 103 103 104 104 unset( $GLOBALS['wp_taxonomies'][ $tax_name ] ); … … 141 141 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 142 142 $this->assertNotIXRError( $results ); 143 $this->assert Equals( 1, count( $results ) );144 $this->assert Equals( $name, $results[0]['name'] );143 $this->assertSame( 1, count( $results ) ); 144 $this->assertSame( $name, $results[0]['name'] ); 145 145 $this->assertEquals( $name_id, $results[0]['term_id'] ); 146 146 … … 149 149 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 150 150 $this->assertNotIXRError( $results2 ); 151 $this->assert Equals( 1, count( $results2 ) );152 $this->assert Equals( $name, $results2[0]['name'] );151 $this->assertSame( 1, count( $results2 ) ); 152 $this->assertSame( $name, $results2[0]['name'] ); 153 153 $this->assertEquals( $name_id, $results2[0]['term_id'] ); 154 154 }
Note: See TracChangeset
for help on using the changeset viewer.