File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,13 @@ public function testCensoredWordsNonReplacement(): void
263
263
264
264
public function testHighlightCode (): void
265
265
{
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 (PHP_VERSION_ID >= 80300 ) {
268
+ $ 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> " ;
271
+ }
272
+
267
273
$ this ->assertSame ($ expect , highlight_code ('<?php var_dump($this); ?> ' ));
268
274
}
269
275
Original file line number Diff line number Diff line change @@ -181,6 +181,21 @@ public function testHighlightCode(): void
181
181
</span>
182
182
</code>
183
183
EOF;
184
+
185
+ // PHP 8.3 changes the output.
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 {
191
+ $ expected = <<<'EOF'
192
+ <code><span style="color: #000000">
193
+ <span style="color: #0000BB">Sincerely </span>
194
+ </span>
195
+ </code>
196
+ EOF;
197
+ }
198
+
184
199
$ this ->assertSame ($ expected , $ parser ->renderString ($ template ));
185
200
}
186
201
You can’t perform that action at this time.
0 commit comments