From 200b518e47a241b79c9f32fef1c160ad0a855e53 Mon Sep 17 00:00:00 2001 From: Aditya Dhade Date: Thu, 9 Jan 2025 21:54:11 +0530 Subject: [PATCH] Fix far future headers tests failing due to updated error messages --- .../far-future-headers/test-far-future-headers.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/performance-lab/tests/includes/site-health/far-future-headers/test-far-future-headers.php b/plugins/performance-lab/tests/includes/site-health/far-future-headers/test-far-future-headers.php index 89484158d..593f8d8f5 100644 --- a/plugins/performance-lab/tests/includes/site-health/far-future-headers/test-far-future-headers.php +++ b/plugins/performance-lab/tests/includes/site-health/far-future-headers/test-far-future-headers.php @@ -91,8 +91,8 @@ public function test_status_messages(): void { ); $this->assertEquals( 'recommended', $result['final_status'] ); - $this->assertEquals( 'max-age below threshold', $result['details'][0]['reason'] ); - $this->assertEquals( 'expires below threshold', $result['details'][1]['reason'] ); + $this->assertStringContainsString( 'max-age below threshold (actual:', $result['details'][0]['reason'] ); + $this->assertStringContainsString( 'expires below threshold (actual:', $result['details'][1]['reason'] ); $this->assertEquals( 'No far-future headers but conditionally cached', $result['details'][2]['reason'] ); $this->assertEquals( 'No far-future headers and no conditional caching', $result['details'][3]['reason'] ); } @@ -135,9 +135,9 @@ static function () { ); $this->assertEquals( 'recommended', $result['final_status'] ); - $this->assertEquals( 'max-age below threshold', $result['details'][0]['reason'] ); - $this->assertEquals( 'expires below threshold', $result['details'][1]['reason'] ); - $this->assertEquals( 'max-age below threshold', $result['details'][2]['reason'] ); + $this->assertStringContainsString( 'max-age below threshold (actual:', $result['details'][0]['reason'] ); + $this->assertStringContainsString( 'expires below threshold (actual:', $result['details'][1]['reason'] ); + $this->assertStringContainsString( 'max-age below threshold (actual:', $result['details'][2]['reason'] ); } /**