Skip to content

Commit c1a126f

Browse files
committed
Return early if core cache functions are already defined, usefull for PHPUnit tests for instance.
1 parent 1fa2aa9 commit c1a126f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drop-in.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ private function get_cache_file_path( $key, $group ) {
556556
/**
557557
* Core cache functions implementation.
558558
*/
559+
if ( function_exists( 'wp_cache_init' ) ) {
560+
// Should not happen except in PHPUnit tests.
561+
return;
562+
}
559563

560564
// phpcs:disable NeutronStandard.Globals.DisallowGlobalFunctions.GlobalFunctions
561565
// phpcs:disable Squiz.Commenting.FunctionComment.Missing

0 commit comments

Comments
 (0)