1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-26 20:04:48 +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:
Nikita Popov 2020-09-19 15:52:05 +02:00
parent 8505acd151
commit 1899471f80

View File

@ -121,9 +121,11 @@ class ConstExprEvaluatorTest extends \PHPUnit\Framework\TestCase
'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,
'Division by zero'
\PHP_VERSION_ID >= 80000
? 'A non-numeric value encountered'
: 'A non well formed numeric value encountered'
],
];
}