respect-validation/tests/unit/Rules/CurrencyCodeTest.php

60 lines
1.2 KiB
PHP
Raw Normal View History

2015-10-18 16:02:48 +02:00
<?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);
2015-10-18 16:02:48 +02:00
namespace Respect\Validation\Rules;
use Respect\Validation\Test\RuleTestCase;
2015-10-18 16:02:48 +02:00
/**
* @group rule
*
2017-02-04 14:01:14 +01:00
* @covers \Respect\Validation\Rules\CurrencyCode
*
* @author Henrique Moody <henriquemoody@gmail.com>
* @author Justin Hook <justinhook88@yahoo.co.uk>
* @author William Espindola <oi@williamespindola.com.br>
2015-10-18 16:02:48 +02:00
*/
final class CurrencyCodeTest extends RuleTestCase
2015-10-18 16:02:48 +02:00
{
/**
* {@inheritdoc}
*/
public function providerForValidInput(): array
2015-10-18 16:02:48 +02:00
{
$rule = new CurrencyCode();
return [
[$rule, 'EUR'],
[$rule, 'GBP'],
[$rule, 'XAU'],
[$rule, 'XBA'],
[$rule, 'XXX'],
2015-10-18 16:02:48 +02:00
];
}
/**
* {@inheritdoc}
*/
public function providerForInvalidInput(): array
2015-10-18 16:02:48 +02:00
{
$rule = new CurrencyCode();
return [
[$rule, 'BTC'],
[$rule, 'GGP'],
[$rule, 'USA'],
[$rule, 'xxx'],
2015-10-18 16:02:48 +02:00
];
}
}