Changeset 43729 for branches/5.0/tests/phpunit/tests/term/meta.php
- Timestamp:
- 10/15/2018 11:45:16 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/tests/phpunit/tests/term/meta.php
r43510 r43729 510 510 ); 511 511 } 512 513 /** 514 * @ticket 44467 515 */ 516 public function test_add_metadata_sets_terms_last_changed() { 517 $term_id = self::factory()->term->create(); 518 519 wp_cache_delete( 'last_changed', 'terms' ); 520 521 $this->assertInternalType( 'integer', add_metadata( 'term', $term_id, 'foo', 'bar' ) ); 522 $this->assertNotFalse( wp_cache_get_last_changed( 'terms' ) ); 523 } 524 525 /** 526 * @ticket 44467 527 */ 528 public function test_update_metadata_sets_terms_last_changed() { 529 $term_id = self::factory()->term->create(); 530 531 wp_cache_delete( 'last_changed', 'terms' ); 532 533 $this->assertInternalType( 'integer', update_metadata( 'term', $term_id, 'foo', 'bar' ) ); 534 $this->assertNotFalse( wp_cache_get_last_changed( 'terms' ) ); 535 } 536 537 /** 538 * @ticket 44467 539 */ 540 public function test_delete_metadata_sets_terms_last_changed() { 541 $term_id = self::factory()->term->create(); 542 543 update_metadata( 'term', $term_id, 'foo', 'bar' ); 544 wp_cache_delete( 'last_changed', 'terms' ); 545 546 $this->assertTrue( delete_metadata( 'term', $term_id, 'foo' ) ); 547 $this->assertNotFalse( wp_cache_get_last_changed( 'terms' ) ); 548 } 549 550 /** 551 * @ticket 44467 552 */ 553 public function test_metadata_functions_respect_term_meta_support() { 554 $term_id = self::factory()->term->create(); 555 556 $meta_id = add_metadata( 'term', $term_id, 'foo', 'bar' ); 557 558 // Set database version to last version before term meta support. 559 update_option( 'db_version', 34369 ); 560 561 $this->assertFalse( get_metadata( 'term', $term_id, 'foo', true ) ); 562 $this->assertFalse( add_metadata( 'term', $term_id, 'foo', 'bar' ) ); 563 $this->assertFalse( update_metadata( 'term', $term_id, 'foo', 'bar' ) ); 564 $this->assertFalse( delete_metadata( 'term', $term_id, 'foo' ) ); 565 $this->assertFalse( get_metadata_by_mid( 'term', $meta_id ) ); 566 $this->assertFalse( update_metadata_by_mid( 'term', $meta_id, 'baz' ) ); 567 $this->assertFalse( delete_metadata_by_mid( 'term', $meta_id ) ); 568 $this->assertFalse( update_meta_cache( 'term', array( $term_id ) ) ); 569 } 512 570 }
Note: See TracChangeset
for help on using the changeset viewer.