respect-validation/tests/feature/SetTemplateWithMultipleValidatorsShouldUseTemplateAsMainMessageTest.php
Henrique Moody 92d53f096d
Rename "Callback" validator to "Satisfies"
The previous name was confusing as it focused on the implementation
detail (receiving a callback) rather than what the validator actually
does. The new name "Satisfies" better conveys the validator's purpose:
checking whether the input satisfies a given condition.

Assisted-by: Claude Code (Opus 4.5)
2026-02-02 01:40:14 +01:00

16 lines
495 B
PHP

<?php
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: (c) Respect Project Contributors
* SPDX-FileContributor: Henrique Moody <henriquemoody@gmail.com>
*/
declare(strict_types=1);
use Respect\Validation\ValidatorBuilder;
test('Scenario #1', catchMessage(function (): void {
v::templated('{{subject}} is not tasty', ValidatorBuilder::satisfies('is_int')->between(1, 2))->assert('something');
},
fn(string $message) => expect($message)->toBe('"something" is not tasty')));