diff --git a/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php b/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php index 3def9a4d..1fdeac21 100644 --- a/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php +++ b/Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php @@ -239,6 +239,9 @@ public function testInteger() $this->assertFalse($this->object->evaluate('123.0')); $this->assertFalse($this->object->evaluate('123.1')); $this->assertFalse($this->object->evaluate('a')); + $this->assertFalse($this->object->evaluate(' 1')); + $this->assertFalse($this->object->evaluate('01')); + $this->assertFalse($this->object->evaluate('1 ')); $this->assertTrue($this->object->evaluate('-123')); } @@ -253,6 +256,9 @@ public function testPositive() $this->assertFalse($this->object->evaluate('0')); $this->assertFalse($this->object->evaluate(FALSE)); $this->assertFalse($this->object->evaluate(-1)); + $this->assertFalse($this->object->evaluate('a')); + $this->assertFalse($this->object->evaluate(' 1.1')); + $this->assertFalse($this->object->evaluate('1 ')); } public function testNegative() @@ -298,6 +304,14 @@ public function testEqualTo() $this->assertFalse($this->object->evaluate('101')); } + public function testStringEqualTo() + { + $o = $this->object->equalTo('0'); + $this->assertSame($this->object, $o); + $this->assertTrue($this->object->evaluate('0')); + $this->assertFalse($this->object->evaluate('00')); + } + /** * @exp */