File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,14 @@ public function testCensoredWordsNonReplacement(): void
263263
264264 public function testHighlightCode (): void
265265 {
266- $ expect = "<code><span style= \"color: #000000 \"> \n<span style= \"color: #0000BB \"><?php var_dump</span><span style= \"color: #007700 \">(</span><span style= \"color: #0000BB \"> \$this</span><span style= \"color: #007700 \">); </span><span style= \"color: #0000BB \">?> </span> \n</span> \n</code> " ;
266+ // PHP 8.3 changes the output.
267+ if (version_compare (PHP_VERSION , '8.3 ' , '< ' )) {
268+ $ expect = "<code><span style= \"color: #000000 \"> \n<span style= \"color: #0000BB \"><?php var_dump</span><span style= \"color: #007700 \">(</span><span style= \"color: #0000BB \"> \$this</span><span style= \"color: #007700 \">); </span><span style= \"color: #0000BB \">?> </span> \n</span> \n</code> " ;
269+ } else {
270+ // PHP 8.3
271+ $ expect = '<pre><code style="color: #000000"><span style="color: #0000BB"><?php var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">); </span><span style="color: #0000BB">?> ?></span></code></pre> ' ;
272+ }
273+
267274 $ this ->assertSame ($ expect , highlight_code ('<?php var_dump($this); ?> ' ));
268275 }
269276
Original file line number Diff line number Diff line change @@ -181,6 +181,22 @@ public function testHighlightCode(): void
181181 </span>
182182 </code>
183183 EOF;
184+
185+ // PHP 8.3 changes the output.
186+ if (version_compare (PHP_VERSION , '8.3 ' , '< ' )) {
187+ $ expected = <<<'EOF'
188+ <code><span style="color: #000000">
189+ <span style="color: #0000BB">Sincerely </span>
190+ </span>
191+ </code>
192+ EOF;
193+ } else {
194+ // PHP 8.3
195+ $ expected = <<<'EOF'
196+ <pre><code style="color: #000000"><span style="color: #0000BB">Sincerely ?></span></code></pre>
197+ EOF;
198+ }
199+
184200 $ this ->assertSame ($ expected , $ parser ->renderString ($ template ));
185201 }
186202
You can’t perform that action at this time.
0 commit comments