From 913ca2700e0545403f786f467b10c1309e158c50 Mon Sep 17 00:00:00 2001 From: Davide Principi Date: Mon, 2 Mar 2015 18:13:45 +0100 Subject: [PATCH] Added special test case. Refs #3044 --- Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php b/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php index 1fdeac21..2a89fb36 100644 --- a/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php +++ b/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php @@ -609,4 +609,14 @@ public function testCidrBlock() $this->assertFalse($o->evaluate('12.13.14.300/12')); } + public function testBug3044() + { + $o = $this->object->integer()->greatThan(0)->lessThan(256); + $this->assertTrue($o->evaluate('1')); + $this->assertTrue($o->evaluate('255')); + $this->assertTrue($o->evaluate('32')); + $this->assertFalse($o->evaluate('01')); + $this->assertFalse($o->evaluate(' 1')); + $this->assertFalse($o->evaluate('255 ')); + } }