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

15 lines
386 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
use Respect\Validation\Validator;
test('Scenario', catchMessage(
fn() => Validator::callback('is_int')->setTemplate('{{name}} is not tasty')->assert('something'),
fn(string $message) => expect($message)->toBe('"something" is not tasty'),
));