diff --git a/tests/system/Helpers/TextHelperTest.php b/tests/system/Helpers/TextHelperTest.php
index 4d0295e11d46..2af7f1387529 100755
--- a/tests/system/Helpers/TextHelperTest.php
+++ b/tests/system/Helpers/TextHelperTest.php
@@ -263,7 +263,13 @@ public function testCensoredWordsNonReplacement(): void
public function testHighlightCode(): void
{
- $expect = "\n<?php var_dump(\$this); ?> \n\n
";
+ // PHP 8.3 changes the output.
+ if (PHP_VERSION_ID >= 80300) {
+ $expect = '
<?php var_dump($this); ?> ?>
';
+ } else {
+ $expect = "\n<?php var_dump(\$this); ?> \n\n
";
+ }
+
$this->assertSame($expect, highlight_code(''));
}
diff --git a/tests/system/View/ParserFilterTest.php b/tests/system/View/ParserFilterTest.php
index 7b41da6060fa..694f3252e539 100644
--- a/tests/system/View/ParserFilterTest.php
+++ b/tests/system/View/ParserFilterTest.php
@@ -181,6 +181,21 @@ public function testHighlightCode(): void
EOF;
+
+ // PHP 8.3 changes the output.
+ if (PHP_VERSION_ID >= 80300) {
+ $expected = <<<'EOF'
+ Sincerely ?>
+ EOF;
+ } else {
+ $expected = <<<'EOF'
+
+ Sincerely
+
+
+ EOF;
+ }
+
$this->assertSame($expected, $parser->renderString($template));
}