Make WordPress Core

Changeset 35108


Ignore:
Timestamp:
10/13/2015 02:06:19 AM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/cache.php

    r34765 r35108  
    2020
    2121    function &init_cache() {
    22         $cache = new WP_Object_Cache();
     22        global $wp_object_cache;
     23        $cache_class = get_class( $wp_object_cache );
     24        $cache = new $cache_class();
    2325        $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' ) );
    2426        return $cache;
Note: See TracChangeset for help on using the changeset viewer.