diff --git a/tests/phpunit/tests/speculative-loading/wpPrintSpeculationRules.php b/tests/phpunit/tests/speculative-loading/wpPrintSpeculationRules.php
index e2887f8b0b6ce..12d8a7edcee79 100644
--- a/tests/phpunit/tests/speculative-loading/wpPrintSpeculationRules.php
+++ b/tests/phpunit/tests/speculative-loading/wpPrintSpeculationRules.php
@@ -52,9 +52,9 @@ static function () {
);
$output = get_echo( 'wp_print_speculation_rules' );
- $this->assertStringContainsString( '' ), '', $output );
+ $json = str_replace( array( '