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
This commit is contained in:
parent
a326105ade
commit
20225eb62a
|
@ -19,7 +19,9 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
function &init_cache() {
|
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' ) );
|
$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;
|
return $cache;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue