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

36 lines
886 B
PHP
Raw Normal View History

2015-08-20 05:55:32 +02:00
<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
2015-08-20 05:55:32 +02:00
*/
declare(strict_types=1);
2015-08-20 05:55:32 +02:00
namespace Respect\Validation\Rules;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use Respect\Validation\Test\TestCase;
2017-11-04 11:21:40 +01:00
#[Group('rule')]
#[CoversClass(ResourceType::class)]
final class ResourceTypeTest extends TestCase
2015-08-20 05:55:32 +02:00
{
#[Test]
#[DataProvider('providerForResourceType')]
public function shouldValidateValidInput(mixed $input): void
2015-08-20 05:55:32 +02:00
{
self::assertValidInput(new ResourceType(), $input);
2015-08-20 05:55:32 +02:00
}
#[Test]
#[DataProvider('providerForNonResourceType')]
public function shouldValidateInvalidInput(mixed $input): void
2015-08-20 05:55:32 +02:00
{
self::assertInvalidInput(new ResourceType(), $input);
2015-08-20 05:55:32 +02:00
}
}