Skip to content

Commit e893af2

Browse files
committed
Fix highlight_code() test
1 parent a1c9c34 commit e893af2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/codeigniter/helpers/text_helper_test.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ public function test_censored_words()
101101

102102
public function test_highlight_code()
103103
{
104-
$expect = "<code><span style=\"color: #000000\">\n<span style=\"color: #0000BB\">&lt;?php&nbsp;var_dump</span><span style=\"color: #007700\">(</span><span style=\"color: #0000BB\">\$this</span><span style=\"color: #007700\">);&nbsp;</span><span style=\"color: #0000BB\">?&gt;&nbsp;</span>\n</span>\n</code>";
104+
if (PHP_VERSION_ID >= 80300) {
105+
$expect = "<pre><code style=\"color: #000000\"><span style=\"color: #0000BB\">&lt;?php var_dump</span><span style=\"color: #007700\">(</span><span style=\"color: #0000BB\">\$this</span><span style=\"color: #007700\">); </span><span style=\"color: #0000BB\">?&gt; ?&gt;</span></code></pre>";
106+
} else {
107+
$expect = "<code><span style=\"color: #000000\">\n<span style=\"color: #0000BB\">&lt;?php&nbsp;var_dump</span><span style=\"color: #007700\">(</span><span style=\"color: #0000BB\">\$this</span><span style=\"color: #007700\">);&nbsp;</span><span style=\"color: #0000BB\">?&gt;&nbsp;</span>\n</span>\n</code>";
108+
}
105109

106110
$this->assertEquals($expect, highlight_code('<?php var_dump($this); ?>'));
107111
}

0 commit comments

Comments
 (0)