Merge branch '1.0'

This commit is contained in:
Henrique Moody 2015-11-04 15:17:55 -02:00
commit 7bc0cb94f3
2 changed files with 3 additions and 1 deletions

View file

@ -26,7 +26,7 @@ class MinimumAge extends AbstractRule
public function validate($input)
{
if (!is_int($this->age)) {
if (!filter_var($this->age, FILTER_VALIDATE_INT)) {
return false;
}

View file

@ -58,6 +58,8 @@ class MininumAgeTest extends \PHPUnit_Framework_TestCase
[18, 'Y-m-d', '1969-07-20'],
[18, null, new \DateTime('1969-07-20')],
[18, 'Y-m-d', new \DateTime('1969-07-20')],
['18', 'Y-m-d', '1969-07-20'],
[18.0, 'Y-m-d', '1969-07-20'],
];
}