mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 23:05:45 +01:00
I ran the `bin/console spdx --fix` with different strategies for different files. For most of the core classes, since they've been drastically rebuilt, I've run it with the `git-blame` strategy, for for the `src/Validators`, in which the API changed completely but the logic remains the same, I use the `git-log` strategy.
51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
/*
|
|
* SPDX-License-Identifier: MIT
|
|
* SPDX-FileCopyrightText: (c) Respect Project Contributors
|
|
* SPDX-FileContributor: Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-FileContributor: Andreas Wolf <dev@a-w.io>
|
|
* SPDX-FileContributor: Gabriel Caruso <carusogabriel34@gmail.com>
|
|
* SPDX-FileContributor: Henrique Moody <henriquemoody@gmail.com>
|
|
* SPDX-FileContributor: William Espindola <oi@williamespindola.com.br>
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Validators;
|
|
|
|
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;
|
|
|
|
#[Group('validator')]
|
|
#[CoversClass(AlwaysInvalid::class)]
|
|
final class AlwaysInvalidTest extends TestCase
|
|
{
|
|
#[Test]
|
|
#[DataProvider('providerForInvalidInput')]
|
|
public function itShouldAlwaysBeInvalid(mixed $input): void
|
|
{
|
|
$validator = new AlwaysInvalid();
|
|
|
|
self::assertFalse($validator->evaluate($input)->hasPassed);
|
|
}
|
|
|
|
/** @return mixed[][] */
|
|
public static function providerForInvalidInput(): iterable
|
|
{
|
|
return [
|
|
[0],
|
|
[1],
|
|
['string'],
|
|
[true],
|
|
[false],
|
|
[null],
|
|
[''],
|
|
[[]],
|
|
[['array_full']],
|
|
];
|
|
}
|
|
}
|