mirror of
https://github.com/Respect/Validation.git
synced 2024-06-13 19:22:16 +02:00
cc20a442a1
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
23 lines
531 B
PHP
23 lines
531 B
PHP
--CREDITS--
|
|
Henrique Moody <henriquemoody@gmail.com>
|
|
--TEST--
|
|
setTemplate() with multiple validators should use template as main message
|
|
--FILE--
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require 'vendor/autoload.php';
|
|
|
|
use Respect\Validation\Exceptions\NestedValidationException;
|
|
use Respect\Validation\Validator;
|
|
|
|
try {
|
|
Validator::callback('is_int')->between(1, 2)->setTemplate('{{name}} is not tasty')->assert('something');
|
|
} catch (NestedValidationException $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
"something" is not tasty
|