Skip to content

Commit 3c771b9

Browse files
committed
Fix test
1 parent 381b2f2 commit 3c771b9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/test-phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113

114114
steps:
115115
- name: Checkout
116-
uses: actions/checkout@v3
116+
uses: actions/checkout@v4
117117
- name: Override PHP ini values for JIT compiler
118118
if: matrix.compiler == 'jit'
119119
run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV
@@ -131,7 +131,7 @@ jobs:
131131
id: composer-cache
132132
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
133133
- name: Cache composer dependencies
134-
uses: actions/cache@v3
134+
uses: actions/cache@v4
135135
with:
136136
path: ${{ steps.composer-cache.outputs.dir }}
137137
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

tests/codeigniter/helpers/text_helper_test.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,15 @@ 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 (substr(PHP_VERSION, 0, 3) >= '8.3')
105+
{
106+
$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>";
107+
}
108+
else
109+
{
110+
$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>";
111+
}
112+
105113

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

0 commit comments

Comments
 (0)