Skip to content

Commit 1899471

Browse files
committed
Update test for PHP 8 error behavior
Replace division by zero with a different error condition that still warns, and adjust the expected message based on PHP version.
1 parent 8505acd commit 1899471

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/PhpParser/ConstExprEvaluatorTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,11 @@ public function provideTestEvaluateSilently() {
121121
'Modulo by zero'
122122
],
123123
[
124-
new Expr\BinaryOp\Div(new Scalar\LNumber(42), new Scalar\LNumber(0)),
124+
new Expr\BinaryOp\Plus(new Scalar\LNumber(42), new Scalar\String_("1foo")),
125125
\ErrorException::class,
126-
'Division by zero'
126+
\PHP_VERSION_ID >= 80000
127+
? 'A non-numeric value encountered'
128+
: 'A non well formed numeric value encountered'
127129
],
128130
];
129131
}

0 commit comments

Comments
 (0)