respect-validation/tests/feature/SetTemplateWithMultipleValidatorsShouldUseTemplateAsFullMessageHeaderTest.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

17 lines
540 B
PHP

<?php
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: (c) Respect Project Contributors
* SPDX-FileContributor: Henrique Moody <henriquemoody@gmail.com>
*/
declare(strict_types=1);
test('Scenario #1', catchFullMessage(
fn() => v::templated('{{subject}} is not tasty', v::satisfies('is_string')->between(1, 2))->assert('something'),
fn(string $fullMessage) => expect($fullMessage)->toBe(<<<'FULL_MESSAGE'
- "something" is not tasty
- "something" must be between 1 and 2
FULL_MESSAGE),
));