diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php b/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
index 86abe7f5aeffb..7cde415f0f796 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
@@ -254,7 +254,7 @@ private static function build_tree_representation( ?string $fragment_context, st
}
if ( '' !== $text_node ) {
- $output .= "${text_node}\"\n";
+ $output .= "{$text_node}\"\n";
}
// Tests always end with a trailing newline.