mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 06:45: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
469 B
PHP
16 lines
469 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', catchMessage(
|
|
fn() => v::templated('{{subject}} is not tasty', ValidatorBuilder::satisfies('is_int'))->assert('something'),
|
|
fn(string $message) => expect($message)->toBe('"something" is not tasty'),
|
|
));
|