@@ -302,20 +302,13 @@ function ( string $content ): string {
302
302
* @dataProvider data_provider_test_picture_element_source_tag_srcset_has_same_image_sizes_as_img_tag_srcset
303
303
* @covers ::webp_uploads_wrap_image_in_picture
304
304
*
305
- * @param Closure|null $set_up Set up the test.
306
- * @param array<string>|null $custom_sizes Custom image sizes.
305
+ * @param Closure|null $set_up Set up the test.
307
306
*/
308
- public function test_picture_element_source_tag_srcset_has_same_image_sizes_as_img_tag_srcset ( ?Closure $ set_up, ? array $ custom_sizes ): void {
307
+ public function test_picture_element_source_tag_srcset_has_same_image_sizes_as_img_tag_srcset ( ?Closure $ set_up ): void {
309
308
if ( $ set_up instanceof Closure ) {
310
309
$ set_up ();
311
310
}
312
311
313
- if ( is_array ( $ custom_sizes ) ) {
314
- foreach ( $ custom_sizes as $ size ) {
315
- $ this ->temp_custom_image_sizes [] = $ size ;
316
- }
317
- }
318
-
319
312
update_option ( 'perflab_generate_webp_and_jpeg ' , '1 ' );
320
313
update_option ( 'perflab_generate_all_fallback_sizes ' , '1 ' );
321
314
@@ -371,17 +364,17 @@ public function test_picture_element_source_tag_srcset_has_same_image_sizes_as_i
371
364
/**
372
365
* Data provider for test_picture_element_source_tag_srcset_has_same_image_sizes_as_img_tag_srcset.
373
366
*
374
- * @return array<string, array{ set_up: Closure|null, custom_sizes: array<string>|null }>
367
+ * @return array<string, array{ set_up: Closure|null }>
375
368
*/
376
369
public function data_provider_test_picture_element_source_tag_srcset_has_same_image_sizes_as_img_tag_srcset (): array {
377
370
return array (
378
371
'default_sizes ' => array (
379
- 'set_up ' => null ,
380
- 'custom_sizes ' => null ,
372
+ 'set_up ' => null ,
381
373
),
382
374
'when_two_different_image_sizes_have_same_width ' => array (
383
- 'set_up ' => static function (): void {
375
+ 'set_up ' => function (): void {
384
376
add_image_size ( 'square ' , 768 , 768 , true );
377
+ $ this ->temp_custom_image_sizes [] = 'square ' ;
385
378
add_filter (
386
379
'pre_option_medium_large_size_w ' ,
387
380
static function () {
@@ -395,7 +388,6 @@ static function () {
395
388
}
396
389
);
397
390
},
398
- 'custom_sizes ' => array ( 'square ' ),
399
391
),
400
392
);
401
393
}
0 commit comments