File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -264,11 +264,10 @@ public function testCensoredWordsNonReplacement(): void
264264 public function testHighlightCode (): void
265265 {
266266 // 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
267+ if (PHP_VERSION_ID >= 80300 ) {
271268 $ 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> ' ;
269+ } else {
270+ $ 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> " ;
272271 }
273272
274273 $ this ->assertSame ($ expect , highlight_code ('<?php var_dump($this); ?> ' ));
Original file line number Diff line number Diff line change @@ -183,18 +183,17 @@ public function testHighlightCode(): void
183183 EOF;
184184
185185 // PHP 8.3 changes the output.
186- if (version_compare (PHP_VERSION , '8.3 ' , '< ' )) {
186+ if (PHP_VERSION_ID >= 80300 ) {
187+ $ expected = <<<'EOF'
188+ <pre><code style="color: #000000"><span style="color: #0000BB">Sincerely ?></span></code></pre>
189+ EOF;
190+ } else {
187191 $ expected = <<<'EOF'
188192 <code><span style="color: #000000">
189193 <span style="color: #0000BB">Sincerely </span>
190194 </span>
191195 </code>
192196 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;
198197 }
199198
200199 $ this ->assertSame ($ expected , $ parser ->renderString ($ template ));
You can’t perform that action at this time.
0 commit comments