mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
This commit also replaces PHPUnit annotations with attributes. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
39 lines
1,018 B
PHP
39 lines
1,018 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Helpers;
|
|
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
use PHPUnit\Framework\Attributes\DataProvider;
|
|
use PHPUnit\Framework\Attributes\Group;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use Respect\Validation\Test\DataProvider\UndefinedProvider;
|
|
use Respect\Validation\Test\TestCase;
|
|
|
|
#[Group('helper')]
|
|
#[CoversClass(CanValidateUndefined::class)]
|
|
final class CanValidateUndefinedTest extends TestCase
|
|
{
|
|
use CanValidateUndefined;
|
|
use UndefinedProvider;
|
|
|
|
#[Test]
|
|
#[DataProvider('providerForUndefined')]
|
|
public function shouldFindWhenValueIsUndefined(mixed $value): void
|
|
{
|
|
self::assertTrue($this->isUndefined($value));
|
|
}
|
|
|
|
#[Test]
|
|
#[DataProvider('providerForNotUndefined')]
|
|
public function shouldFindWhenValueIsNotUndefined(mixed $value): void
|
|
{
|
|
self::assertFalse($this->isUndefined($value));
|
|
}
|
|
}
|