File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
tests/phpunit/tests/option Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -564,6 +564,12 @@ public function test_get_option_does_not_hit_the_external_cache_multiple_times_f
564
564
add_option ( $ option_name , 'value ' );
565
565
}
566
566
567
+ if ( wp_using_ext_object_cache () ) {
568
+ $ expected = 1 ;
569
+ } else {
570
+ $ expected = 0 ;
571
+ }
572
+
567
573
$ number_external_cache_hits = 0 ;
568
574
569
575
add_action (
@@ -573,12 +579,19 @@ function () use ( &$number_external_cache_hits ) {
573
579
}
574
580
);
575
581
582
+ add_action (
583
+ 'wp_memcached_external_set ' ,
584
+ function () use ( &$ number_external_cache_hits ) {
585
+ $ number_external_cache_hits ++;
586
+ }
587
+ );
588
+
576
589
$ call_getter = 10 ;
577
590
while ( $ call_getter -- ) {
578
591
get_option ( $ option_name );
579
592
}
580
593
581
- $ this ->assertSame ( 0 , $ number_external_cache_hits );
594
+ $ this ->assertSame ( $ expected , $ number_external_cache_hits );
582
595
}
583
596
584
597
/**
You can’t perform that action at this time.
0 commit comments