Skip to content

Commit

Permalink
Adding more asserts for Validation::count()
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Apr 27, 2016
1 parent 92e6f56 commit 7bec27a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/TestCase/Validation/ValidationTest.php
Expand Up @@ -2785,10 +2785,18 @@ public function testCount()
$this->assertFalse(Validation::count($int, '>', 8));
$this->assertFalse(Validation::count($int, '<', 1));

$int = 0;
$this->assertTrue(Validation::count($int, '==', 0));
$this->assertTrue(Validation::count(0, '==', 0));
$this->assertFalse(Validation::count(1, '==', 0));

$this->assertFalse(Validation::count(null, '==', 0));
$this->assertFalse(Validation::count(new \stdClass(), '==', 0));

$callable = function() {
return '';
};

$this->assertFalse(Validation::count($callable, '==', 0));
$this->assertFalse(Validation::count(false, '==', 0));
$this->assertFalse(Validation::count(true, '==', 0));
}
}

0 comments on commit 7bec27a

Please sign in to comment.