Changeset 40417 for trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.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/editTerm.php
r39189 r40417 23 23 function test_invalid_username_password() { 24 24 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) ); 25 $this->assertI nstanceOf( 'IXR_Error',$result );25 $this->assertIXRError( $result ); 26 26 $this->assertEquals( 403, $result->code ); 27 27 } … … 31 31 32 32 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) ); 33 $this->assertI nstanceOf( 'IXR_Error',$result );33 $this->assertIXRError( $result ); 34 34 $this->assertEquals( 403, $result->code ); 35 35 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 40 40 41 41 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'not_existing' ) ) ); 42 $this->assertI nstanceOf( 'IXR_Error',$result );42 $this->assertIXRError( $result ); 43 43 $this->assertEquals( 403, $result->code ); 44 44 $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); … … 49 49 50 50 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'category' ) ) ); 51 $this->assertI nstanceOf( 'IXR_Error',$result );51 $this->assertIXRError( $result ); 52 52 $this->assertEquals( 401, $result->code ); 53 53 $this->assertEquals( __( 'Sorry, you are not allowed to edit this term.' ), $result->message ); … … 58 58 59 59 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) ); 60 $this->assertI nstanceOf( 'IXR_Error',$result );60 $this->assertIXRError( $result ); 61 61 $this->assertEquals( 404, $result->code ); 62 62 $this->assertEquals( __( 'Invalid term ID.' ), $result->message ); … … 67 67 68 68 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) ); 69 $this->assertI nstanceOf( 'IXR_Error',$result );69 $this->assertIXRError( $result ); 70 70 $this->assertEquals( 500, $result->code ); 71 71 $this->assertEquals( __('Empty Term'), $result->message ); … … 76 76 77 77 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$parent_term, array( 'taxonomy' => 'category', 'name' => '' ) ) ); 78 $this->assertI nstanceOf( 'IXR_Error',$result );78 $this->assertIXRError( $result ); 79 79 $this->assertEquals( 403, $result->code ); 80 80 $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message ); … … 85 85 86 86 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$post_tag, array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term ) ) ); 87 $this->assertI nstanceOf( 'IXR_Error',$result );87 $this->assertIXRError( $result ); 88 88 $this->assertEquals( 403, $result->code ); 89 89 $this->assertEquals( __( "This taxonomy is not hierarchical so you can't set a parent." ), $result->message ); … … 94 94 95 95 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) ); 96 $this->assertNotI nstanceOf( 'IXR_Error',$result );96 $this->assertNotIXRError( $result ); 97 97 $this->assertTrue( $result ); 98 98 } … … 103 103 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) ); 104 104 105 $this->assertNotI nstanceOf( 'IXR_Error',$result );105 $this->assertNotIXRError( $result ); 106 106 $this->assertInternalType( 'boolean', $result ); 107 107 … … 114 114 115 115 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) ); 116 $this->assertI nstanceOf( 'IXR_Error',$result );116 $this->assertIXRError( $result ); 117 117 $this->assertEquals( 500, $result->code ); 118 118 } … … 122 122 123 123 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) ); 124 $this->assertI nstanceOf( 'IXR_Error',$result );124 $this->assertIXRError( $result ); 125 125 $this->assertEquals( 403, $result->code ); 126 126 $this->assertEquals( __( 'Parent term does not exist.' ), $result->message ); … … 132 132 $parent_term = get_term_by( 'id', self::$parent_term, 'category' ); 133 133 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) ); 134 $this->assertI nstanceOf( 'IXR_Error',$result );134 $this->assertIXRError( $result ); 135 135 $this->assertEquals( 500, $result->code ); 136 136 $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term'), $parent_term->slug ) ), $result->message ); … … 143 143 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, $fields ) ); 144 144 145 $this->assertNotI nstanceOf( 'IXR_Error',$result );145 $this->assertNotIXRError( $result ); 146 146 $this->assertInternalType( 'boolean', $result ); 147 147 }
Note: See TracChangeset
for help on using the changeset viewer.