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