1
0
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:
David Grudl
2020-10-15 16:50:37 +02:00
parent 3f7171c7a4
commit fa6a1203a9
4 changed files with 17 additions and 12 deletions

View File

@@ -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']));

View File

@@ -1,9 +1,5 @@
<?php
/**
* @phpversion 5.5
*/
declare(strict_types=1);
use Tester\Assert;