respect-validation/tests/unit/Rules/IntValTest.php
Henrique Moody ee1d49a2cf
Apply "Squiz.PHP.CommentedOutCode"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:08:41 +01:00

68 lines
1.5 KiB
PHP

<?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Respect\Validation\Rules;
use Respect\Validation\Test\RuleTestCase;
/**
* @group rule
*
* @covers \Respect\Validation\Rules\IntVal
*
* @author Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
* @author Danilo Benevides <danilobenevides01@gmail.com>
* @author Gabriel Caruso <carusogabriel34@gmail.com>
* @author Henrique Moody <henriquemoody@gmail.com>
*/
final class IntValTest extends RuleTestCase
{
/**
* {@inheritdoc}
*/
public function providerForValidInput(): array
{
$rule = new IntVal();
return [
[$rule, 16],
[$rule, '165'],
[$rule, 123456],
[$rule, PHP_INT_MAX],
[$rule, '06'],
[$rule, '0'],
];
}
/**
* {@inheritdoc}
*/
public function providerForInvalidInput(): array
{
$rule = new IntVal();
return [
[$rule, ''],
[$rule, null],
[$rule, 'a'],
[$rule, '1.0'],
[$rule, 1.0],
[$rule, ' '],
[$rule, true],
[$rule, false],
[$rule, 'Foo'],
[$rule, '1.44'],
[$rule, 1e-5],
];
}
}