diff --git a/tests/Fixtures/inc/Engine/Media/AboveTheFold/WarmUp/Controller/fetchLinks.php b/tests/Fixtures/inc/Engine/Media/AboveTheFold/WarmUp/Controller/fetchLinks.php index 0a2211646e..817a11076c 100644 --- a/tests/Fixtures/inc/Engine/Media/AboveTheFold/WarmUp/Controller/fetchLinks.php +++ b/tests/Fixtures/inc/Engine/Media/AboveTheFold/WarmUp/Controller/fetchLinks.php @@ -7,6 +7,7 @@ $html_links_without_duplicate = 'Hello WorldAnother DayRich Dad Poor DadHello WorldAnother DayRich Dad Poor DadBuy (He came to set the captives free) - Rebecca Brown'; $html_links_with_relative_url = 'Hello WorldAnother DayRich Dad Poor DadBuy (He came to set the captives free) - Rebecca Brown'; $html_with_ten_links_and_home = 'Hello World 2Hello World 3Hello World 4Hello World 5Hello World 6Hello World 7Hello World 8Hello World 9Rich Dad Poor DadBuy (He came to set the captives free) - Rebecca BrownHome'; +$html_with_external_links_before_internal = ''; return [ 'shouldReturnEmptyWhenLicenseExpired' => [ @@ -213,4 +214,33 @@ 'https://example.org', ], ], -]; + 'shouldReturnTenLinksWithExternalLinksBeforeInternal' => [ + 'config' => [ + 'license_expired' => false, + 'headers' => [ + 'user-agent' => 'WP Rocket/Pre-fetch Home Links', + 'timeout' => 60, + ], + 'found_link' => true, + 'response' => [ + 'body' => $html_with_external_links_before_internal, + 'response' => [ + 'code' => 200, + ], + ], + ], + 'expected' => [ + 'https://example.org/delay-js-script-add-to-any', + 'https://example.org/accordion-toggle', + 'https://example.org/cover-galleries', + 'https://example.org/countdown-timer', + 'https://example.org/cover-galleries-2', + 'https://example.org/cover-galleries-3', + 'https://example.org/cover-galleries-4', + 'https://example.org/cover-galleries-5', + 'https://example.org/cover-galleries-6', + 'https://example.org/cover-galleries-7', + 'https://example.org', + ], + ], +]; \ No newline at end of file