diff --git a/tests/modules/images/image-loading-optimization/optimization-tests.php b/tests/modules/images/image-loading-optimization/optimization-tests.php index 4009300ad..0714ead3f 100644 --- a/tests/modules/images/image-loading-optimization/optimization-tests.php +++ b/tests/modules/images/image-loading-optimization/optimization-tests.php @@ -265,6 +265,53 @@ public function data_provider_test_ilo_optimize_template_output_buffer(): array ', ), + 'common-lcp-background-image-with-fully-populated-sample-data' => array( + 'set_up' => function () { + $slug = ilo_get_url_metrics_slug( ilo_get_normalized_query_vars() ); + $sample_size = ilo_get_url_metrics_breakpoint_sample_size(); + foreach ( array_merge( ilo_get_breakpoint_max_widths(), array( 1000 ) ) as $viewport_width ) { + for ( $i = 0; $i < $sample_size; $i++ ) { + ilo_store_url_metric( + home_url( '/' ), + $slug, + $this->get_validated_url_metric( + $viewport_width, + array( + array( + 'xpath' => '/*[0][self::HTML]/*[1][self::BODY]/*[0][self::DIV]', + 'isLCP' => true, + ), + ) + ) + ); + } + } + }, + 'buffer' => ' + + + + ... + + +
This is so background!
+ + + ', + 'expected' => ' + + + + ... + + + +
This is so background!
+ + + ', + ), + 'fetch-priority-high-already-on-common-lcp-image-with-fully-populated-sample-data' => array( 'set_up' => function () { $slug = ilo_get_url_metrics_slug( ilo_get_normalized_query_vars() );