Changeset 40916 for trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php
- Timestamp:
- 06/18/2017 10:39:12 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php
r40417 r40916 146 146 $this->assertInternalType( 'boolean', $result ); 147 147 } 148 149 /** 150 * @ticket 35991 151 */ 152 public function test_update_term_meta() { 153 register_taxonomy( 'wptests_tax', 'post' ); 154 155 $t = self::factory()->term->create( array( 156 'taxonomy' => 'wptests_tax', 157 ) ); 158 $meta_id = add_term_meta( $t, 'foo', 'bar' ); 159 160 $this->make_user_by_role( 'editor' ); 161 162 $result = $this->myxmlrpcserver->wp_editTerm( array( 163 1, 164 'editor', 165 'editor', 166 $t, 167 array( 168 'taxonomy' => 'wptests_tax', 169 'custom_fields' => array( 170 array( 171 'id' => $meta_id, 172 'key' => 'foo', 173 'value' => 'baz', 174 ), 175 ), 176 ), 177 ) ); 178 179 $this->assertNotIXRError( $result ); 180 181 $found = get_term_meta( $t, 'foo', true ); 182 $this->assertSame( 'baz', $found ); 183 } 184 185 /** 186 * @ticket 35991 187 */ 188 public function test_delete_term_meta() { 189 register_taxonomy( 'wptests_tax', 'post' ); 190 191 $t = self::factory()->term->create( array( 192 'taxonomy' => 'wptests_tax', 193 ) ); 194 $meta_id = add_term_meta( $t, 'foo', 'bar' ); 195 196 $this->make_user_by_role( 'editor' ); 197 198 $result = $this->myxmlrpcserver->wp_editTerm( array( 199 1, 200 'editor', 201 'editor', 202 $t, 203 array( 204 'taxonomy' => 'wptests_tax', 205 'custom_fields' => array( 206 array( 207 'id' => $meta_id, 208 ), 209 ), 210 ), 211 ) ); 212 213 $this->assertNotIXRError( $result ); 214 215 $found = get_term_meta( $t, 'foo' ); 216 $this->assertSame( array(), $found ); 217 } 148 218 }
Note: See TracChangeset
for help on using the changeset viewer.