Changeset 27101 for trunk/tests/phpunit/tests/term.php
- Timestamp:
- 02/06/2014 01:40:05 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term.php
r27099 r27101 572 572 * @ticket 22526 573 573 */ 574 function test_get_taxonomy_last_changed() { 575 $last_changed = get_taxonomy_last_changed( 'category' ); 576 $last_changed_cache = wp_cache_get( 'last_changed', 'category' ); 577 $this->assertEquals( $last_changed, $last_changed_cache ); 578 wp_cache_delete( 'last_changed', 'category' ); 579 $this->assertEquals( $last_changed, $last_changed_cache ); 580 $last_changed = get_taxonomy_last_changed( 'category' ); 581 $this->assertNotEquals( $last_changed, $last_changed_cache ); 582 583 $last_changed2 = get_taxonomy_last_changed( 'category' ); 584 $this->factory->category->create(); 585 $last_changed3 = get_taxonomy_last_changed( 'category' ); 586 $this->assertNotEquals( $last_changed2, $last_changed3 ); 587 } 588 589 /** 590 * @ticket 22526 591 */ 592 function test_set_taxonomy_last_changed() { 593 $last_changed1 = set_taxonomy_last_changed( 'category' ); 594 $last_changed2 = set_taxonomy_last_changed( 'category' ); 595 $this->assertNotEquals( $last_changed1, $last_changed2 ); 596 597 $last_changed3 = set_taxonomy_last_changed( 'category' ); 598 $last_changed4 = get_taxonomy_last_changed( 'category' ); 599 $this->assertEquals( $last_changed3, $last_changed4 ); 600 } 601 602 /** 603 * @ticket 22526 604 */ 605 function test_post_taxonomy_is_fresh() { 606 $post_id = $this->factory->post->create(); 607 $term_id = $this->factory->category->create( array( 'name' => 'Foo' ) ); 608 wp_set_post_categories( $post_id, $term_id ); 609 610 $this->assertFalse( post_taxonomy_is_fresh( $post_id, 'category' ) ); 611 $this->assertTrue( post_taxonomy_is_fresh( $post_id, 'category' ) ); 612 $this->assertTrue( post_taxonomy_is_fresh( $post_id, 'category' ) ); 613 614 wp_update_term( $term_id, 'category', array( 'name' => 'Bar' ) ); 615 616 $this->assertFalse( post_taxonomy_is_fresh( $post_id, 'category' ) ); 617 get_the_category( $post_id ); 618 $this->assertTrue( post_taxonomy_is_fresh( $post_id, 'category' ) ); 619 } 620 621 /** 622 * @ticket 22526 623 */ 574 624 function test_category_name_change() { 575 625 $term = $this->factory->category->create_and_get( array( 'name' => 'Foo' ) );
Note: See TracChangeset
for help on using the changeset viewer.