mirror of
https://github.com/Respect/Validation.git
synced 2024-06-01 21:32:14 +02:00
Apply contribution guidelines to "Vatin" rule
As the "Vatin" rule is a "Plvatin" wrapper I considered using the same unit tests from "PlVatin" to "Vatin".
This commit is contained in:
parent
5aba4c8889
commit
b8508e989a
|
@ -13,19 +13,57 @@ declare(strict_types=1);
|
|||
|
||||
namespace Respect\Validation\Rules;
|
||||
|
||||
use Respect\Validation\Test\TestCase;
|
||||
use Respect\Validation\Test\RuleTestCase;
|
||||
use Respect\Validation\Validatable;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* @group rule
|
||||
* @group rule
|
||||
*
|
||||
* @covers \Respect\Validation\Rules\Vatin
|
||||
*
|
||||
* @author Danilo Correa <danilosilva87@gmail.com>
|
||||
* @author Gabriel Caruso <carusogabriel34@gmail.com>
|
||||
* @author Henrique Moody <henriquemoody@gmail.com>
|
||||
* @author Tomasz Regdos <tomek@regdos.com>
|
||||
*/
|
||||
final class VatinTest extends TestCase
|
||||
final class VatinTest extends RuleTestCase
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function providerForValidInput(): array
|
||||
{
|
||||
$countryCode = 'PL';
|
||||
$rule = new Vatin($countryCode);
|
||||
|
||||
return [
|
||||
[$rule, '1645865777'],
|
||||
[$rule, '5581418257'],
|
||||
[$rule, '1298727531'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function providerForInvalidInput(): array
|
||||
{
|
||||
$countryCode = 'PL';
|
||||
$rule = new Vatin($countryCode);
|
||||
|
||||
return [
|
||||
[$rule, []],
|
||||
[$rule, new stdClass()],
|
||||
[$rule, '1645865778'],
|
||||
[$rule, '164-586-57-77'],
|
||||
[$rule, '164-58-65-777'],
|
||||
[$rule, '5581418258'],
|
||||
[$rule, '1298727532'],
|
||||
[$rule, '1234567890'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue