Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eldadfux committed Jun 21, 2020
1 parent 0820938 commit 23156b3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/Validator/BooleanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ public function tearDown()
public function testIsValid()
{
$this->boolean = new Boolean();

$this->assertEquals(true, $this->boolean->isValid(true));
$this->assertEquals(true, $this->boolean->isValid(false));
$this->assertEquals(false, $this->boolean->isValid('false'));
$this->assertEquals(false, $this->boolean->isValid('true'));
$this->assertEquals(false, $this->boolean->isValid('0'));
$this->assertEquals(false, $this->boolean->isValid('1'));
$this->assertEquals(false, $this->boolean->isValid(0));
$this->assertEquals(false, $this->boolean->isValid(1));
$this->assertEquals(false, $this->boolean->isValid(['string', 'string']));
$this->assertEquals(false, $this->boolean->isValid('string'));
$this->assertEquals(false, $this->boolean->isValid(1));
$this->assertEquals(false, $this->boolean->isValid(1.2));

$this->boolean = new Boolean(true);
Expand All @@ -50,9 +53,12 @@ public function testIsValid()
$this->assertEquals(true, $this->boolean->isValid(false));
$this->assertEquals(true, $this->boolean->isValid('false'));
$this->assertEquals(true, $this->boolean->isValid('true'));
$this->assertEquals(true, $this->boolean->isValid('0'));
$this->assertEquals(true, $this->boolean->isValid('1'));
$this->assertEquals(true, $this->boolean->isValid(0));
$this->assertEquals(true, $this->boolean->isValid(1));
$this->assertEquals(false, $this->boolean->isValid(['string', 'string']));
$this->assertEquals(false, $this->boolean->isValid('string'));
$this->assertEquals(false, $this->boolean->isValid(1));
$this->assertEquals(false, $this->boolean->isValid(1.2));
}
}

0 comments on commit 23156b3

Please sign in to comment.