Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.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/newTerm.php
r39189 r40417 16 16 function test_invalid_username_password() { 17 17 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) ); 18 $this->assertI nstanceOf( 'IXR_Error',$result );18 $this->assertIXRError( $result ); 19 19 $this->assertEquals( 403, $result->code ); 20 20 } … … 24 24 25 25 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) ); 26 $this->assertI nstanceOf( 'IXR_Error',$result );26 $this->assertIXRError( $result ); 27 27 $this->assertEquals( 403, $result->code ); 28 28 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 33 33 34 34 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) ); 35 $this->assertI nstanceOf( 'IXR_Error',$result );35 $this->assertIXRError( $result ); 36 36 $this->assertEquals( 403, $result->code ); 37 37 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 42 42 43 43 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) ); 44 $this->assertI nstanceOf( 'IXR_Error',$result );44 $this->assertIXRError( $result ); 45 45 $this->assertEquals( 401, $result->code ); 46 46 $this->assertEquals( __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), $result->message ); … … 51 51 52 52 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) ); 53 $this->assertI nstanceOf( 'IXR_Error',$result );53 $this->assertIXRError( $result ); 54 54 $this->assertEquals( 403, $result->code ); 55 55 $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message ); … … 60 60 61 61 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) ); 62 $this->assertI nstanceOf( 'IXR_Error',$result );62 $this->assertIXRError( $result ); 63 63 $this->assertEquals( 403, $result->code ); 64 64 $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message ); … … 69 69 70 70 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) ); 71 $this->assertI nstanceOf( 'IXR_Error',$result );71 $this->assertIXRError( $result ); 72 72 $this->assertEquals( 500, $result->code ); 73 73 } … … 77 77 78 78 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) ); 79 $this->assertI nstanceOf( 'IXR_Error',$result );79 $this->assertIXRError( $result ); 80 80 $this->assertEquals( 403, $result->code ); 81 81 $this->assertEquals( __( 'Parent term does not exist.' ), $result->message ); … … 87 87 88 88 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) ); 89 $this->assertNotI nstanceOf( 'IXR_Error',$result );89 $this->assertNotIXRError( $result ); 90 90 $this->assertStringMatchesFormat( '%d', $result ); 91 91 } … … 95 95 96 96 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) ); 97 $this->assertNotI nstanceOf( 'IXR_Error',$result );97 $this->assertNotIXRError( $result ); 98 98 $this->assertStringMatchesFormat( '%d', $result ); 99 99 } … … 104 104 $taxonomy = array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' ); 105 105 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) ); 106 $this->assertNotI nstanceOf( 'IXR_Error',$result );106 $this->assertNotIXRError( $result ); 107 107 $this->assertStringMatchesFormat( '%d', $result ); 108 108 }
Note: See TracChangeset
for help on using the changeset viewer.