File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace NewfoldLabs \WP \Module \Performance \HealthChecks ;
4
4
5
- use function NewfoldLabs \WP \Module \LinkTracker \Functions \build_link as buildLink ;
6
5
/**
7
6
* Health check for persistent object cache.
8
7
*/
Original file line number Diff line number Diff line change 2
2
3
3
namespace NewfoldLabs \WP \Module \Performance \HealthChecks ;
4
4
5
- use Mockery ;
6
5
use WP_Mock ;
7
6
use WP_Mock \Tools \TestCase ;
8
7
use Patchwork ;
@@ -329,15 +328,18 @@ public function test_defer_non_essential_js_health_check() {
329
328
* Test PersistentObjectCacheHealthCheck.
330
329
*/
331
330
public function test_persistent_object_cache_health_check () {
331
+ WP_Mock::userFunction ( 'wp_using_ext_object_cache ' )
332
+ ->once ()
333
+ ->andReturn ( true );
332
334
333
- $ mock = Mockery::mock ( 'PersistentObjectCacheHealthCheck ' );
334
-
335
- $ mock ->shouldReceive ( 'test ' )->once ()->andReturn ( true );
336
- $ this ->assertTrue ( $ mock ->test (), 'Persistent object caching should pass when enabled. ' );
335
+ $ health_check = new PersistentObjectCacheHealthCheck ();
336
+ $ this ->assertTrue ( $ health_check ->test (), 'Persistent object caching should pass when enabled. ' );
337
337
338
- $ mock ->shouldReceive ( 'test ' )->once ()->andReturn ( false );
338
+ WP_Mock::userFunction ( 'wp_using_ext_object_cache ' )
339
+ ->once ()
340
+ ->andReturn ( false );
339
341
340
- $ this ->assertFalse ( $ mock ->test (), 'Persistent object caching should fail when not enabled. ' );
342
+ $ this ->assertFalse ( $ health_check ->test (), 'Persistent object caching should fail when not enabled. ' );
341
343
}
342
344
343
345
/**
You can’t perform that action at this time.
0 commit comments