Tests: Add missing global cache groups.

Add `useremail`, `userslugs`, `networks`, `sites`, and `site-details` as global cache groups when added with unit tests. This aligns the list with the core default.

Fixes #40283.


git-svn-id: https://develop.svn.wordpress.org/trunk@40343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2017-03-28 01:45:43 +00:00
parent b36363bb69
commit 308554bd84
2 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
$wp_object_cache->__remoteset(); $wp_object_cache->__remoteset();
} }
wp_cache_flush(); wp_cache_flush();
wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) ); wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) );
wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) ); wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
} }

View File

@ -22,7 +22,7 @@ class Tests_Cache extends WP_UnitTestCase {
global $wp_object_cache; global $wp_object_cache;
$cache_class = get_class( $wp_object_cache ); $cache_class = get_class( $wp_object_cache );
$cache = new $cache_class(); $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', 'useremail', 'userslugs', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) );
return $cache; return $cache;
} }