mirror of
https://github.com/Respect/Validation.git
synced 2024-06-28 02:00:06 +02:00
"MinimumAge" rule must accept any kind of integer
This commit is contained in:
parent
aaca258bed
commit
b98595a5c0
|
@ -16,7 +16,7 @@ class MinimumAge extends AbstractRule
|
|||
|
||||
public function validate($input)
|
||||
{
|
||||
if (!is_int($this->age)) {
|
||||
if (!filter_var($this->age, FILTER_VALIDATE_INT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,8 @@ class MinimumAgeTest extends \PHPUnit_Framework_TestCase
|
|||
array(18, 'Y-m-d', '1969-07-20'),
|
||||
array(18, null, new \DateTime('1969-07-20')),
|
||||
array(18, 'Y-m-d', new \DateTime('1969-07-20')),
|
||||
array('18', 'Y-m-d', '1969-07-20'),
|
||||
array(18.0, 'Y-m-d', '1969-07-20'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue