mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 07:15:45 +01:00
16 lines
533 B
PHP
16 lines
533 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
test('https://github.com/Respect/Validation/issues/739', catchAll(
|
|
fn() => v::when(v::alwaysInvalid(), v::alwaysValid())->assert('foo'),
|
|
fn(string $message, string $fullMessage, array $messages) => expect()
|
|
->and($message)->toBe('"foo" is invalid')
|
|
->and($fullMessage)->toBe('- "foo" is invalid')
|
|
->and($messages)->toBe(['alwaysInvalid' => '"foo" is invalid']),
|
|
));
|