Skip to content

Commit 056aa40

Browse files
committed
Fixed test in php8.4
1 parent 40e7bf3 commit 056aa40

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

tests/038.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
Check for Yaf_View_Simple error message outputing
33
--SKIPIF--
4-
<?php if (!extension_loaded("yaf")) print "skip"; ?>
4+
<?php
5+
if (!extension_loaded("yaf")) die("skip");
6+
if (version_compare(PHP_VERSION, "8.4", "ge")) print "skip only for <= 8.3";
7+
?>
58
--INI--
69
yaf.library="/php/global/dir"
710
log_errors=0
@@ -34,4 +37,4 @@ require "build.inc";
3437
shutdown();
3538
?>
3639
--EXPECTF--
37-
Parse error: syntax error, unexpected %s}%c in %sfoo.phtml on line %d
40+
Parse error: syntax error, unexpected %s}%c in %sfoo.phtml on line %d

tests/039.phpt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
--TEST--
22
Check for Yaf_View_Simple recursive render error message outputing
33
--SKIPIF--
4-
<?php if (!extension_loaded("yaf")) print "skip"; ?>
4+
<?php
5+
if (!extension_loaded("yaf")) die("skip");
6+
?>
57
--INI--
68
yaf.library="/php/global/dir"
79
log_errors=0
@@ -35,7 +37,20 @@ HTML
3537
try {
3638
echo $view->render($tpl, array('tpl' => $tpl2));
3739
} catch (Error $e) {
38-
echo $e->getMessage();
40+
$msg = $e->getMessage();
41+
if (version_compare(PHP_VERSION, "8.4", "ge")) {
42+
if (strcmp("syntax error, unexpected token \"{\"", $msg) == 0) {
43+
echo "okey";
44+
} else {
45+
echo $msg;
46+
}
47+
} else {
48+
if (strcmp("syntax error, unexpected token \"}\"", $msg) == 0) {
49+
echo "okey";
50+
} else {
51+
echo $msg;
52+
}
53+
}
3954
}
4055
?>
4156
--CLEAN--
@@ -44,5 +59,5 @@ try {
4459
require "build.inc";
4560
shutdown();
4661
?>
47-
--EXPECTF--
48-
syntax error, unexpected %s}%c
62+
--EXPECT--
63+
okey

0 commit comments

Comments
 (0)