Skip to content

Commit

Permalink
ValidatorTest: added more strict tests. Refs #3067
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidePrincipi committed Mar 2, 2015
1 parent 488c88e commit f400c86
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Nethgui/Test/Unit/Nethgui/System/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand All @@ -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()
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit f400c86

Please sign in to comment.