Clean up cache invalidation suspension global in unit tests.
This fixes a test that was introduced in [30073] which was polluting later tests. See #21760. git-svn-id: https://develop.svn.wordpress.org/trunk@30112 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
325c0622c9
commit
df5e0a00b8
@ -197,7 +197,7 @@ class Tests_Term_Cache extends WP_UnitTestCase {
|
|||||||
$this->assertSame( $term_id, wp_cache_get( $cache_key_slug, $taxonomy . ':slugs:' . wp_cache_get( 'last_changed', 'terms' ) ) );
|
$this->assertSame( $term_id, wp_cache_get( $cache_key_slug, $taxonomy . ':slugs:' . wp_cache_get( 'last_changed', 'terms' ) ) );
|
||||||
$this->assertSame( $term_id, wp_cache_get( $cache_key_name, $taxonomy . ':names:' . wp_cache_get( 'last_changed', 'terms' ) ) );
|
$this->assertSame( $term_id, wp_cache_get( $cache_key_name, $taxonomy . ':names:' . wp_cache_get( 'last_changed', 'terms' ) ) );
|
||||||
|
|
||||||
wp_suspend_cache_invalidation();
|
$suspend = wp_suspend_cache_invalidation();
|
||||||
clean_term_cache( $term_id, $taxonomy );
|
clean_term_cache( $term_id, $taxonomy );
|
||||||
|
|
||||||
// Verify that the cached value still matches the correct value
|
// Verify that the cached value still matches the correct value
|
||||||
@ -207,5 +207,8 @@ class Tests_Term_Cache extends WP_UnitTestCase {
|
|||||||
|
|
||||||
// Verify that last changed has not been updated as part of an invalidation routine
|
// Verify that last changed has not been updated as part of an invalidation routine
|
||||||
$this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'terms' ) );
|
$this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'terms' ) );
|
||||||
|
|
||||||
|
// Clean up.
|
||||||
|
wp_suspend_cache_invalidation( $suspend );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user