respect-validation/tests/integration/issue-739.phpt
Henrique Moody 9322cd6375
Do not create results with siblings in the When rule
When creating a result with a sibling in the When rule, the result
generates an unhelpful message. In most of the use cases of the When
rule, the initial rule ("when") is only helpful in determining which
will be the "real" rule to use.

Those changes will change the When rule not to generate results with
siblings.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-25 23:47:25 +01:00

13 lines
240 B
PHP

--FILE--
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Respect\Validation\Validator as v;
exceptionMessage(static fn() => v::when(v::alwaysInvalid(), v::alwaysValid())->check('foo'));
?>
--EXPECT--
"foo" is not valid