mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-11-30 04:19:30 +01:00
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.
This commit is contained in:
parent
8505acd151
commit
1899471f80
@ -121,9 +121,11 @@ class ConstExprEvaluatorTest extends \PHPUnit\Framework\TestCase
|
|||||||
'Modulo by zero'
|
'Modulo by zero'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
new Expr\BinaryOp\Div(new Scalar\LNumber(42), new Scalar\LNumber(0)),
|
new Expr\BinaryOp\Plus(new Scalar\LNumber(42), new Scalar\String_("1foo")),
|
||||||
\ErrorException::class,
|
\ErrorException::class,
|
||||||
'Division by zero'
|
\PHP_VERSION_ID >= 80000
|
||||||
|
? 'A non-numeric value encountered'
|
||||||
|
: 'A non well formed numeric value encountered'
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user