From 2636f5e55b8a90dcf5e6d08e4410dd81d712f735 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 22 Nov 2014 22:47:18 +0700 Subject: [PATCH 1/3] updated test case to fit with set error self::NOT_FLOAT --- test/Validator/FloatTest.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/Validator/FloatTest.php b/test/Validator/FloatTest.php index 42a09dfa..824d8b18 100644 --- a/test/Validator/FloatTest.php +++ b/test/Validator/FloatTest.php @@ -222,24 +222,13 @@ public function testEqualsMessageTemplates() } /** - * @group ZF2-6647 - * @dataProvider notFloatProvider + * @group 6647 */ - public function testNotFloat($value) + public function testNotFloat() { - $this->assertFalse($this->validator->isValid($value)); + $this->assertFalse($this->validator->isValid('2.000.000,00')); $message = $this->validator->getMessages(); $this->assertContains('does not appear to be a float', $message['notFloat']); } - - public function notFloatProvider() - { - return array( - array( - 'hello', - 2.000,000 - ), - ); - } } From 59254dc17d1ba33f2baddecd1c13002713a51beb Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 27 Nov 2014 19:46:01 +0100 Subject: [PATCH 2/3] zendframework/zf2#6647 zendframework/zf2#6648 - minor CS fixes (spacing) --- src/Validator/Float.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Validator/Float.php b/src/Validator/Float.php index a2ded7fb..746ef33c 100644 --- a/src/Validator/Float.php +++ b/src/Validator/Float.php @@ -163,6 +163,7 @@ public function isValid($value) //We have seperators, and they are flipped. i.e. 2.000,000 for en-US if ($groupSeparatorPosition && $decSeparatorPosition && $groupSeparatorPosition > $decSeparatorPosition) { $this->error(self::NOT_FLOAT); + return false; } @@ -239,6 +240,7 @@ public function isValid($value) } $this->error(self::NOT_FLOAT); + return false; } } From 6eee880330e2eb43f124c8a2dbeed94424749a7b Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 27 Nov 2014 19:46:49 +0100 Subject: [PATCH 3/3] zendframework/zf2#6647 zendframework/zf2#6648 - adding `@group` annotation referencing the open pull request --- test/Validator/FloatTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Validator/FloatTest.php b/test/Validator/FloatTest.php index 824d8b18..bd9a9cec 100644 --- a/test/Validator/FloatTest.php +++ b/test/Validator/FloatTest.php @@ -223,6 +223,7 @@ public function testEqualsMessageTemplates() /** * @group 6647 + * @group 6648 */ public function testNotFloat() {