From 20225eb62a62baef5aafbdb2248c78c541cfbeae Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 13 Oct 2015 02:06:19 +0000 Subject: [PATCH] In cache tests, determine cache class name dynamically. Some cache backends may use a class name other than `WP_Object_Cache` for their cache drop-in. For example, certain versions of the APC Object Cache plugin have a shim called `APC_Object_Cache`. See #31491. git-svn-id: https://develop.svn.wordpress.org/trunk@35108 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/cache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index d3805383a7..bc671ecd86 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -19,7 +19,9 @@ class Tests_Cache extends WP_UnitTestCase { } function &init_cache() { - $cache = new WP_Object_Cache(); + global $wp_object_cache; + $cache_class = get_class( $wp_object_cache ); + $cache = new $cache_class(); $cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) ); return $cache; }