mirror of
https://github.com/dg/dibi.git
synced 2025-08-13 01:24:06 +02:00
fixed compatibility with PHP 8 [Closes #379]
This commit is contained in:
@@ -147,7 +147,14 @@ test('', function () {
|
||||
Assert::same(['col' => 1], $result->test(['col' => true]));
|
||||
Assert::same(['col' => 0], $result->test(['col' => false]));
|
||||
|
||||
Assert::same(['col' => 0], @$result->test(['col' => ''])); // triggers warning in PHP 7.1
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
Assert::same(['col' => 0], @$result->test(['col' => ''])); // triggers warning since PHP 7.1
|
||||
} else {
|
||||
Assert::exception(function () use ($result) {
|
||||
Assert::same(['col' => 0], $result->test(['col' => '']));
|
||||
}, TypeError::class);
|
||||
}
|
||||
|
||||
Assert::same(['col' => 0], $result->test(['col' => '0']));
|
||||
Assert::same(['col' => 1], $result->test(['col' => '1']));
|
||||
Assert::same(['col' => 10], $result->test(['col' => '10']));
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @phpversion 5.5
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
Reference in New Issue
Block a user