diff --git a/plugins/embed-optimizer/tests/test-cases/nested-figure-embed.php b/plugins/embed-optimizer/tests/test-cases/nested-figure-embed.php index 60c56b04a..af194af46 100644 --- a/plugins/embed-optimizer/tests/test-cases/nested-figure-embed.php +++ b/plugins/embed-optimizer/tests/test-cases/nested-figure-embed.php @@ -26,7 +26,7 @@ 'intersectionRatio' => 0, ), ), - false + null ); // This tests how the Embed Optimizer plugin plays along with other tag visitors. diff --git a/plugins/embed-optimizer/tests/test-cases/single-spotify-embed-outside-viewport-with-subsequent-script.php b/plugins/embed-optimizer/tests/test-cases/single-spotify-embed-outside-viewport-with-subsequent-script.php index 484b25cb2..c384a05de 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-spotify-embed-outside-viewport-with-subsequent-script.php +++ b/plugins/embed-optimizer/tests/test-cases/single-spotify-embed-outside-viewport-with-subsequent-script.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - false + null ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport-without-resized-data.php b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport-without-resized-data.php index a477e6558..e8dd3bcfa 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport-without-resized-data.php +++ b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport-without-resized-data.php @@ -10,7 +10,7 @@ // Intentionally omitting resizedBoundingClientRect here to test behavior when data isn't supplied. ), ), - 'embeds' + md5( 'embeds' ) ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport.php index bcf9d4d76..fe9b4e04b 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - 'embeds' + md5( 'embeds' ) ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport-on-mobile.php b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport-on-mobile.php index abe89a61c..e9c11ee49 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport-on-mobile.php +++ b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport-on-mobile.php @@ -22,7 +22,7 @@ od_get_url_metrics_slug( od_get_normalized_query_vars() ), $test_case->get_sample_url_metric( array( - 'etag' => 'embeds', + 'etag' => md5( 'embeds' ), 'viewport_width' => $viewport_width, 'elements' => $elements, ) diff --git a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport.php index 36e2ea087..ef6372277 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - 'embeds' + md5( 'embeds' ) ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-inside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-inside-viewport.php index 85a0e4e8e..e8109f815 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-inside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-inside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - false + null ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-outside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-outside-viewport.php index 7d3cd53df..a9e56d9a7 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-outside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-outside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - false + null ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-inside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-inside-viewport.php index a6bb8384e..5a96738bb 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-inside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-inside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - 'embeds' + md5( 'embeds' ) ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport-on-mobile.php b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport-on-mobile.php index 686be6ad1..7904d893b 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport-on-mobile.php +++ b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport-on-mobile.php @@ -22,7 +22,7 @@ od_get_url_metrics_slug( od_get_normalized_query_vars() ), $test_case->get_sample_url_metric( array( - 'etag' => 'embeds', + 'etag' => md5( 'embeds' ), 'viewport_width' => $viewport_width, 'elements' => $elements, ) diff --git a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport.php b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport.php index 7f7de84cb..bfd546ce7 100644 --- a/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport.php +++ b/plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport.php @@ -10,7 +10,7 @@ 'resizedBoundingClientRect' => array_merge( $test_case->get_sample_dom_rect(), array( 'height' => 500 ) ), ), ), - 'embeds' + md5( 'embeds' ) ); }, 'buffer' => ' diff --git a/plugins/embed-optimizer/tests/test-cases/too-many-bookmarks.php b/plugins/embed-optimizer/tests/test-cases/too-many-bookmarks.php index bd56e9c71..ba36ecc4a 100644 --- a/plugins/embed-optimizer/tests/test-cases/too-many-bookmarks.php +++ b/plugins/embed-optimizer/tests/test-cases/too-many-bookmarks.php @@ -11,7 +11,7 @@ 'intersectionRatio' => 0.0, ), ), - false + null ); // Check what happens when there are too many bookmarks. diff --git a/plugins/image-prioritizer/tests/test-cases/common-lcp-background-image-with-fully-populated-sample-data.php b/plugins/image-prioritizer/tests/test-cases/common-lcp-background-image-with-fully-populated-sample-data.php index d7933e8eb..c87e736fe 100644 --- a/plugins/image-prioritizer/tests/test-cases/common-lcp-background-image-with-fully-populated-sample-data.php +++ b/plugins/image-prioritizer/tests/test-cases/common-lcp-background-image-with-fully-populated-sample-data.php @@ -8,7 +8,7 @@ 'isLCP' => true, ), ), - 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' + md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ) ); }, 'buffer' => ' diff --git a/plugins/image-prioritizer/tests/test-cases/common-lcp-image-and-lazy-loaded-image-outside-viewport-with-fully-populated-sample-data.php b/plugins/image-prioritizer/tests/test-cases/common-lcp-image-and-lazy-loaded-image-outside-viewport-with-fully-populated-sample-data.php index e1b84cb5d..98eb86d89 100644 --- a/plugins/image-prioritizer/tests/test-cases/common-lcp-image-and-lazy-loaded-image-outside-viewport-with-fully-populated-sample-data.php +++ b/plugins/image-prioritizer/tests/test-cases/common-lcp-image-and-lazy-loaded-image-outside-viewport-with-fully-populated-sample-data.php @@ -15,7 +15,7 @@ $slug, $test_case->get_sample_url_metric( array( - 'etag' => 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video', + 'etag' => md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ), 'viewport_width' => $viewport_width, 'elements' => array( array( diff --git a/plugins/image-prioritizer/tests/test-cases/common-lcp-image-with-stale-sample-data.php b/plugins/image-prioritizer/tests/test-cases/common-lcp-image-with-stale-sample-data.php index b542c00a0..c90d5eed1 100644 --- a/plugins/image-prioritizer/tests/test-cases/common-lcp-image-with-stale-sample-data.php +++ b/plugins/image-prioritizer/tests/test-cases/common-lcp-image-with-stale-sample-data.php @@ -8,7 +8,7 @@ 'isLCP' => true, ), ), - 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' + md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ) ); }, 'buffer' => ' diff --git a/plugins/image-prioritizer/tests/test-cases/fetch-priority-high-already-on-common-lcp-image-with-fully-populated-sample-data.php b/plugins/image-prioritizer/tests/test-cases/fetch-priority-high-already-on-common-lcp-image-with-fully-populated-sample-data.php index c69565cc4..a59f1545d 100644 --- a/plugins/image-prioritizer/tests/test-cases/fetch-priority-high-already-on-common-lcp-image-with-fully-populated-sample-data.php +++ b/plugins/image-prioritizer/tests/test-cases/fetch-priority-high-already-on-common-lcp-image-with-fully-populated-sample-data.php @@ -8,7 +8,7 @@ 'xpath' => '/*[1][self::HTML]/*[2][self::BODY]/*[1][self::IMG]', ), ), - 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' + md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ) ); }, 'buffer' => ' diff --git a/plugins/image-prioritizer/tests/test-cases/images-located-above-or-along-initial-viewport.php b/plugins/image-prioritizer/tests/test-cases/images-located-above-or-along-initial-viewport.php index b6885ded3..4e12bde38 100644 --- a/plugins/image-prioritizer/tests/test-cases/images-located-above-or-along-initial-viewport.php +++ b/plugins/image-prioritizer/tests/test-cases/images-located-above-or-along-initial-viewport.php @@ -31,7 +31,7 @@ $slug, $test_case->get_sample_url_metric( array( - 'etag' => 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video', + 'etag' => md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ), 'viewport_width' => $viewport_width, 'elements' => array( array( diff --git a/plugins/image-prioritizer/tests/test-cases/no-lcp-image-or-background-image-outside-viewport-with-populated-url-metrics.php b/plugins/image-prioritizer/tests/test-cases/no-lcp-image-or-background-image-outside-viewport-with-populated-url-metrics.php index bd6007924..507cefeca 100644 --- a/plugins/image-prioritizer/tests/test-cases/no-lcp-image-or-background-image-outside-viewport-with-populated-url-metrics.php +++ b/plugins/image-prioritizer/tests/test-cases/no-lcp-image-or-background-image-outside-viewport-with-populated-url-metrics.php @@ -8,7 +8,7 @@ 'isLCP' => true, ), ), - 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' + md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ) ); }, 'buffer' => ' diff --git a/plugins/image-prioritizer/tests/test-cases/responsive-background-images.php b/plugins/image-prioritizer/tests/test-cases/responsive-background-images.php index 47f21a875..3cc8e7747 100644 --- a/plugins/image-prioritizer/tests/test-cases/responsive-background-images.php +++ b/plugins/image-prioritizer/tests/test-cases/responsive-background-images.php @@ -25,7 +25,7 @@ static function () use ( $mobile_breakpoint, $tablet_breakpoint ): array { $slug, $test_case->get_sample_url_metric( array( - 'etag' => 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video', + 'etag' => md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ), 'viewport_width' => $viewport_width, 'element' => array( 'xpath' => sprintf( '/*[1][self::HTML]/*[2][self::BODY]/*[%d][self::DIV]', $div_index + 1 ), diff --git a/plugins/image-prioritizer/tests/test-helper.php b/plugins/image-prioritizer/tests/test-helper.php index 94614b68a..c84b7202a 100644 --- a/plugins/image-prioritizer/tests/test-helper.php +++ b/plugins/image-prioritizer/tests/test-helper.php @@ -207,7 +207,7 @@ public function data_provider_test_auto_sizes(): array { * @phpstan-param array{ xpath: string, isLCP: bool, intersectionRatio: int } $element_metrics */ public function test_auto_sizes( array $element_metrics, string $buffer, string $expected ): void { - $this->populate_url_metrics( array( $element_metrics ), 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ); + $this->populate_url_metrics( array( $element_metrics ), md5( 'image-prioritizer/img,image-prioritizer/background-image,image-prioritizer/video' ) ); $html_start_doc = '...'; $html_end_doc = ''; diff --git a/tests/class-optimization-detective-test-helpers.php b/tests/class-optimization-detective-test-helpers.php index 7f5fe4c36..a0704a58a 100644 --- a/tests/class-optimization-detective-test-helpers.php +++ b/tests/class-optimization-detective-test-helpers.php @@ -68,7 +68,7 @@ public function get_sample_dom_rect(): array { * Gets a sample URL metric. * * @phpstan-param array{ - * etag?: string, + * etag?: non-empty-string, * url?: string, * viewport_width?: int, * viewport_height?: int,