Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php
r40916 r42343 9 9 10 10 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 11 self::$parent_term_id = $factory->term->create( array( 12 'taxonomy' => 'category', 13 ) ); 11 self::$parent_term_id = $factory->term->create( 12 array( 13 'taxonomy' => 'category', 14 ) 15 ); 14 16 } 15 17 … … 50 52 $this->make_user_by_role( 'editor' ); 51 53 52 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) ); 54 $result = $this->myxmlrpcserver->wp_newTerm( 55 array( 56 1, 57 'editor', 58 'editor', 59 array( 60 'taxonomy' => 'category', 61 'name' => '', 62 ), 63 ) 64 ); 53 65 $this->assertIXRError( $result ); 54 66 $this->assertEquals( 403, $result->code ); … … 59 71 $this->make_user_by_role( 'editor' ); 60 72 61 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) ); 73 $result = $this->myxmlrpcserver->wp_newTerm( 74 array( 75 1, 76 'editor', 77 'editor', 78 array( 79 'taxonomy' => 'post_tag', 80 'parent' => self::$parent_term_id, 81 'name' => 'test', 82 ), 83 ) 84 ); 62 85 $this->assertIXRError( $result ); 63 86 $this->assertEquals( 403, $result->code ); … … 68 91 $this->make_user_by_role( 'editor' ); 69 92 70 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) ); 93 $result = $this->myxmlrpcserver->wp_newTerm( 94 array( 95 1, 96 'editor', 97 'editor', 98 array( 99 'taxonomy' => 'category', 100 'parent' => 'dasda', 101 'name' => 'test', 102 ), 103 ) 104 ); 71 105 $this->assertIXRError( $result ); 72 106 $this->assertEquals( 500, $result->code ); … … 76 110 $this->make_user_by_role( 'editor' ); 77 111 78 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) ); 112 $result = $this->myxmlrpcserver->wp_newTerm( 113 array( 114 1, 115 'editor', 116 'editor', 117 array( 118 'taxonomy' => 'category', 119 'parent' => 9999, 120 'name' => 'test', 121 ), 122 ) 123 ); 79 124 $this->assertIXRError( $result ); 80 125 $this->assertEquals( 403, $result->code ); … … 86 131 $this->make_user_by_role( 'editor' ); 87 132 88 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) ); 133 $result = $this->myxmlrpcserver->wp_newTerm( 134 array( 135 1, 136 'editor', 137 'editor', 138 array( 139 'taxonomy' => 'category', 140 'name' => 'test', 141 ), 142 ) 143 ); 89 144 $this->assertNotIXRError( $result ); 90 145 $this->assertStringMatchesFormat( '%d', $result ); … … 94 149 $this->make_user_by_role( 'editor' ); 95 150 96 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test' ) ) ); 151 $result = $this->myxmlrpcserver->wp_newTerm( 152 array( 153 1, 154 'editor', 155 'editor', 156 array( 157 'taxonomy' => 'category', 158 'parent' => self::$parent_term_id, 159 'name' => 'test', 160 ), 161 ) 162 ); 97 163 $this->assertNotIXRError( $result ); 98 164 $this->assertStringMatchesFormat( '%d', $result ); … … 102 168 $this->make_user_by_role( 'editor' ); 103 169 104 $taxonomy = array( 'taxonomy' => 'category', 'parent' => self::$parent_term_id, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' ); 105 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) ); 170 $taxonomy = array( 171 'taxonomy' => 'category', 172 'parent' => self::$parent_term_id, 173 'name' => 'test_all', 174 'description' => 'Test all', 175 'slug' => 'test_all', 176 ); 177 $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) ); 106 178 $this->assertNotIXRError( $result ); 107 179 $this->assertStringMatchesFormat( '%d', $result ); … … 113 185 public function test_add_term_meta() { 114 186 $this->make_user_by_role( 'editor' ); 115 $result = $this->myxmlrpcserver->wp_newTerm( array( 116 1, 117 'editor', 118 'editor', 119 array( 120 'taxonomy' => 'category', 121 'name' => 'Test meta', 122 'custom_fields' => array( 123 array( 124 'key' => 'key1', 125 'value' => 'value1', 187 $result = $this->myxmlrpcserver->wp_newTerm( 188 array( 189 1, 190 'editor', 191 'editor', 192 array( 193 'taxonomy' => 'category', 194 'name' => 'Test meta', 195 'custom_fields' => array( 196 array( 197 'key' => 'key1', 198 'value' => 'value1', 199 ), 126 200 ), 127 201 ), 128 ) ,129 ) );202 ) 203 ); 130 204 $this->assertNotIXRError( $result ); 131 205 $this->assertStringMatchesFormat( '%d', $result );
Note: See TracChangeset
for help on using the changeset viewer.