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)
16 lines
495 B
PHP
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')));
|