Merge branch '0.9' into 1.0

This commit is contained in:
Henrique Moody 2015-11-06 12:25:14 -02:00
commit 7aaa5c0a83
2 changed files with 3 additions and 2 deletions

View file

@ -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);
}
}

View file

@ -57,13 +57,14 @@ class PerfectSquareTest extends \PHPUnit_Framework_TestCase
['0'],
[81],
[0],
[250],
[2500],
];
}
public function providerForNotPerfectSquare()
{
return [
[250],
[''],
[null],
[7],