File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
plugins/optimization-detective/tests Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -493,6 +493,57 @@ public function data_provider_to_test_add_link(): array {
493
493
'expected_count ' => 1 ,
494
494
'error ' => '' ,
495
495
),
496
+ 'comma_in_query ' => array (
497
+ 'links_args ' => array (
498
+ array (
499
+ array (
500
+ 'rel ' => 'preload ' ,
501
+ 'href ' => 'https://example.com/wp-content/uploads/2025/02/example.png?resize=768,432&ssl=1 ' ,
502
+ 'as ' => 'image ' ,
503
+ ),
504
+ ),
505
+ ),
506
+ 'expected_html ' => '
507
+ <link data-od-added-tag rel="preload" href="https://example.com/wp-content/uploads/2025/02/example.png?resize=768,432&ssl=1" as="image">
508
+ ' ,
509
+ 'expected_header ' => 'Link: <https://example.com/wp-content/uploads/2025/02/example.png?resize=768,432&ssl=1>; rel="preload"; as="image" ' ,
510
+ 'expected_count ' => 1 ,
511
+ 'error ' => '' ,
512
+ ),
513
+ 'percent_encoded_comma_in_query ' => array (
514
+ 'links_args ' => array (
515
+ array (
516
+ array (
517
+ 'rel ' => 'preload ' ,
518
+ 'href ' => 'https://example.com/wp-content/uploads/2025/02/example.png?resize=768%2C432&ssl=1 ' ,
519
+ 'as ' => 'image ' ,
520
+ ),
521
+ ),
522
+ ),
523
+ 'expected_html ' => '
524
+ <link data-od-added-tag rel="preload" href="https://example.com/wp-content/uploads/2025/02/example.png?resize=768%2C432&ssl=1" as="image">
525
+ ' ,
526
+ 'expected_header ' => 'Link: <https://example.com/wp-content/uploads/2025/02/example.png?resize=768%2C432&ssl=1>; rel="preload"; as="image" ' ,
527
+ 'expected_count ' => 1 ,
528
+ 'error ' => '' ,
529
+ ),
530
+ 'percent_encoded_extension ' => array (
531
+ 'links_args ' => array (
532
+ array (
533
+ array (
534
+ 'rel ' => 'preload ' ,
535
+ 'href ' => 'https://example.com/image.%6Apg ' ,
536
+ 'as ' => 'image ' ,
537
+ ),
538
+ ),
539
+ ),
540
+ 'expected_html ' => '
541
+ <link data-od-added-tag rel="preload" href="https://example.com/image.%6Apg" as="image">
542
+ ' ,
543
+ 'expected_header ' => 'Link: <https://example.com/image.%6Apg>; rel="preload"; as="image" ' ,
544
+ 'expected_count ' => 1 ,
545
+ 'error ' => '' ,
546
+ ),
496
547
);
497
548
}
498
549
You can’t perform that action at this time.
0 commit comments