Changeset 40916 for trunk/tests/phpunit/tests/term/meta.php
- Timestamp:
- 06/18/2017 10:39:12 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/meta.php
r37589 r40916 405 405 } 406 406 407 /** 408 * @ticket 35991 409 */ 410 public function test_has_term_meta() { 411 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 412 413 $term_meta_id = add_term_meta( $t, 'foo', 'bar' ); 414 $meta = has_term_meta( $t ); 415 416 $this->assertSame( 1, count( $meta ) ); 417 418 $expected = array( 419 'meta_key' => 'foo', 420 'meta_value' => 'bar', 421 'meta_id' => $term_meta_id, 422 'term_id' => $t, 423 ); 424 425 $found = $meta[0]; 426 427 $this->assertEquals( $expected, $found ); 428 } 429 430 /** 431 * @ticket 35991 432 */ 433 public function test_has_term_meta_empty_results() { 434 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 435 436 $meta = has_term_meta( $t ); 437 438 $this->assertSame( array(), $meta ); 439 } 440 407 441 public static function set_cache_results( $q ) { 408 442 $q->set( 'cache_results', true );
Note: See TracChangeset
for help on using the changeset viewer.