From df5e0a00b8fadfb89c8ef35f58032010e99af144 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 30 Oct 2014 04:14:53 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/term/cache.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/term/cache.php b/tests/phpunit/tests/term/cache.php index 72856e1650..9e922f3c3a 100644 --- a/tests/phpunit/tests/term/cache.php +++ b/tests/phpunit/tests/term/cache.php @@ -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_name, $taxonomy . ':names:' . wp_cache_get( 'last_changed', 'terms' ) ) ); - wp_suspend_cache_invalidation(); + $suspend = wp_suspend_cache_invalidation(); clean_term_cache( $term_id, $taxonomy ); // 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 $this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'terms' ) ); + + // Clean up. + wp_suspend_cache_invalidation( $suspend ); } }