Skip to content

Commit 8557f44

Browse files
authored
Merge pull request #286 from newfold-labs/FIX/PRESS7-515-remove-action-link
removed missing object cache url
2 parents 248b9a3 + e751de2 commit 8557f44

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

includes/HealthChecks/PersistentObjectCacheHealthCheck.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace NewfoldLabs\WP\Module\Performance\HealthChecks;
44

5-
use function NewfoldLabs\WP\Module\LinkTracker\Functions\build_link as buildLink;
65
/**
76
* Health check for persistent object cache.
87
*/
@@ -16,12 +15,6 @@ public function __construct() {
1615
$this->passing_text = esc_html__( 'Object caching is enabled', 'wp-module-performance' );
1716
$this->failing_text = esc_html__( 'Object caching is disabled', 'wp-module-performance' );
1817
$this->description = esc_html__( 'Object caching saves results from frequent database queries, reducing load times by avoiding repetitive query processing. Object caching is available in all tiers of Bluehost Cloud.', 'wp-module-performance' );
19-
$this->actions = sprintf(
20-
'<a href="%1$s" target="_blank" rel="noopener">%2$s</a><span class="screen-reader-text"> (%3$s)</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
21-
buildLink( 'https://www.bluehost.com/help/article/object-caching' ),
22-
esc_html__( 'Learn more about object caching', 'wp-module-performance' ),
23-
__( 'opens in a new tab', 'wp-module-performance' )
24-
);
2518
}
2619

2720
/**

tests/phpunit/includes/HealthChecksTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace NewfoldLabs\WP\Module\Performance\HealthChecks;
44

5-
use Mockery;
65
use WP_Mock;
76
use WP_Mock\Tools\TestCase;
87
use Patchwork;
@@ -329,15 +328,18 @@ public function test_defer_non_essential_js_health_check() {
329328
* Test PersistentObjectCacheHealthCheck.
330329
*/
331330
public function test_persistent_object_cache_health_check() {
331+
WP_Mock::userFunction( 'wp_using_ext_object_cache' )
332+
->once()
333+
->andReturn( true );
332334

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.' );
337337

338-
$mock->shouldReceive( 'test' )->once()->andReturn( false );
338+
WP_Mock::userFunction( 'wp_using_ext_object_cache' )
339+
->once()
340+
->andReturn( false );
339341

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.' );
341343
}
342344

343345
/**

0 commit comments

Comments
 (0)