From 6f8456d80a9ac34c14fe10bb03bb39c2f667ace7 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Mon, 22 Apr 2024 17:23:37 -0600 Subject: [PATCH] lint --- tests/phpunit/test-site-health.php | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/test-site-health.php b/tests/phpunit/test-site-health.php index 85dfdae..3d9eb6d 100644 --- a/tests/phpunit/test-site-health.php +++ b/tests/phpunit/test-site-health.php @@ -1,12 +1,21 @@ [ 'update_temp_backup_writable' => [], @@ -40,9 +49,9 @@ public function test_site_health_mods() { $result = apply_filters( 'site_status_tests', $mock_tests ); - $this->assertArrayNotHasKey('update_temp_backup_writable', $result['direct']); - $this->assertArrayNotHasKey('available_updates_disk_space', $result['direct']); - $this->assertArrayNotHasKey('background_updates', $result['async']); + $this->assertArrayNotHasKey( 'update_temp_backup_writable', $result['direct'] ); + $this->assertArrayNotHasKey( 'available_updates_disk_space', $result['direct'] ); + $this->assertArrayNotHasKey( 'background_updates', $result['async'] ); } public function test_object_cache_no_redis() { @@ -53,8 +62,7 @@ public function test_object_cache_no_redis() { } public function test_object_cache_with_redis_no_plugin() { - // Mock the environment for this scenario - $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set + $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set. $result = Pantheon\Site_Health\test_object_cache(); @@ -63,22 +71,22 @@ public function test_object_cache_with_redis_no_plugin() { } public function test_object_cache_with_wpredis_active() { - $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set + $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set. $this->set_active_plugin( 'wp-redis/wp-redis.php' ); $result = Pantheon\Site_Health\test_object_cache(); $this->assertEquals( 'recommended', $result['status'] ); - $this->assertStringContainsString('WP Redis is active for your site. We recommend using Object Cache Pro.', $result['description'] ); + $this->assertStringContainsString( 'WP Redis is active for your site. We recommend using Object Cache Pro.', $result['description'] ); } public function test_object_cache_with_ocp_active() { - $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set + $_ENV['CACHE_HOST'] = 'cacheserver'; // Ensure CACHE_HOST is set. $this->set_active_plugin( 'object-cache-pro/object-cache-pro.php' ); $result = Pantheon\Site_Health\test_object_cache(); $this->assertEquals( 'good', $result['status'] ); - $this->assertStringContainsString('Object Cache Pro is active for your site.', $result['description'] ); + $this->assertStringContainsString( 'Object Cache Pro is active for your site.', $result['description'] ); } -} \ No newline at end of file +}