/home/techb158/exp.abdallabala.com/vendor/respect/validation/tests/unit/Rules
Edit: /home/techb158/exp.abdallabala.com/vendor/respect/validation/tests/unit/Rules/IntTypeTest.php (1264B)
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
namespace Respect\Validation\Rules;
use Respect\Validation\TestCase;
/**
* @group rule
* @covers Respect\Validation\Rules\IntType
*/
class IntTypeTest extends TestCase
{
public function providerForValidIntType()
{
return [
[0],
[123456],
[PHP_INT_MAX],
[PHP_INT_MAX * -1],
];
}
/**
* @dataProvider providerForValidIntType
*/
public function testShouldValidateInputWhenItIsAValidIntType($input)
{
$rule = new IntType();
$this->assertTrue($rule->validate($input));
}
public function providerForInvalidIntType()
{
return [
['1'],
[1.0],
[PHP_INT_MAX + 1],
[true],
];
}
/**
* @dataProvider providerForInvalidIntType
*/
public function testShouldInvalidateInputWhenItIsNotAValidIntType($input)
{
$rule = new IntType();
$this->assertFalse($rule->validate($input));
}
}