From e199d72d6fbd922e8645c7be834188f62d632a8b Mon Sep 17 00:00:00 2001 From: Denis Smetannikov Date: Sat, 26 Mar 2022 21:03:05 +0200 Subject: [PATCH] Fixed failed test --- src/Filter.php | 2 +- tests/EnvTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Filter.php b/src/Filter.php index 73e5254..987fe8a 100644 --- a/src/Filter.php +++ b/src/Filter.php @@ -150,7 +150,7 @@ public static function bool($variable): bool * @param int $round * @return float */ - public static function float($value, int $round = 16): float + public static function float($value, int $round = 10): float { $cleaned = (string)\preg_replace('#[^\deE\-\.\,]#iu', '', (string)$value); $cleaned = \str_replace(',', '.', $cleaned); diff --git a/tests/EnvTest.php b/tests/EnvTest.php index 2b97a85..b49d05c 100644 --- a/tests/EnvTest.php +++ b/tests/EnvTest.php @@ -18,6 +18,7 @@ namespace JBZoo\PHPUnit; use JBZoo\Utils\Env; +use JBZoo\Utils\Filter; /** * Class EnvTest @@ -94,7 +95,7 @@ public function testInt(): void public function testFloat(): void { - $value = 1 / 3; + $value = Filter::float(1 / 3); putenv("FOO= {$value} "); isSame($value, Env::float('FOO'));