Make WordPress Core

Ticket #31086: 31086.tests.patch

File 31086.tests.patch, 717 bytes (added by joshlevinson, 11 years ago)

Unit tests for 31086.patch

  • tests/phpunit/tests/taxonomy.php

     
    361361                $this->assertEqualSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict' ) );
    362362                _unregister_post_type( 'wptests_pt' );
    363363        }
     364
     365        function test_get_terms_before_after_cache() {
     366
     367                $post_id = $this->factory->post->create();
     368
     369                $fresh_terms = get_the_terms( $post_id, 'category' );
     370                wp_cache_init();
     371                update_object_term_cache( $post_id, 'post' );
     372                $cached_terms = get_the_terms( $post_id, 'category' );
     373                $this->assertEquals( $fresh_terms, $cached_terms );
     374
     375        }
     376
    364377}