Skip to content

Commit 1876481

Browse files
committed
Fix tests
1 parent 131edbf commit 1876481

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/test-phpunit.yml

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

135135
steps:
136136
- name: Checkout
137-
uses: actions/checkout@v2
137+
uses: actions/checkout@v4
138138
- name: Override PHP ini values for JIT compiler
139139
if: matrix.compiler == 'jit'
140140
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
@@ -152,7 +152,7 @@ jobs:
152152
id: composer-cache
153153
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
154154
- name: Cache composer dependencies
155-
uses: actions/cache@v2
155+
uses: actions/cache@v4
156156
with:
157157
path: ${{ steps.composer-cache.outputs.dir }}
158158
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

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)