mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 14:55:44 +01:00
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)
17 lines
540 B
PHP
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),
|
|
));
|