mirror of
https://github.com/Respect/Validation.git
synced 2024-06-28 02:00:06 +02:00
Merge branch '0.9' into 1.0
This commit is contained in:
commit
7aaa5c0a83
|
@ -15,6 +15,6 @@ class PerfectSquare extends AbstractRule
|
|||
{
|
||||
public function validate($input)
|
||||
{
|
||||
return is_numeric($input) && sqrt($input) * sqrt($input) == $input;
|
||||
return is_numeric($input) && floor(sqrt($input)) == sqrt($input);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,13 +57,14 @@ class PerfectSquareTest extends \PHPUnit_Framework_TestCase
|
|||
['0'],
|
||||
[81],
|
||||
[0],
|
||||
[250],
|
||||
[2500],
|
||||
];
|
||||
}
|
||||
|
||||
public function providerForNotPerfectSquare()
|
||||
{
|
||||
return [
|
||||
[250],
|
||||
[''],
|
||||
[null],
|
||||
[7],
|
||||
|
|
Loading…
Reference in a new issue