respect-validation/tests/feature/Issues/Issue1244Test.php
2025-12-18 19:03:39 +01:00

16 lines
569 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/1244', catchAll(
fn() => v::key('firstname', v::notBlank()->setName('First Name'))->assert([]),
fn(string $message, string $fullMessage, array $messages) => expect()
->and($message)->toBe('First Name must be present')
->and($fullMessage)->toBe('- First Name must be present')
->and($messages)->toBe(['firstname' => 'First Name must be present']),
));