respect-validation/tests/integration/not_without_recursion.phpt
Henrique Moody cc20a442a1
Apply "SlevomatCodingStandard.TypeHints.DeclareStrictTypes"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:11:12 +01:00

25 lines
519 B
PHP

--CREDITS--
Henrique Moody <henriquemoody@gmail.com>
--TEST--
not() with recursion should update mode of its children
--FILE--
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Respect\Validation\Exceptions\ValidationException;
use Respect\Validation\Validator;
try {
$validator = Validator::not(
Validator::intVal()->positive()
);
$validator->check(2);
} catch (ValidationException $exception) {
echo $exception->getMessage().PHP_EOL;
}
?>
--EXPECT--
2 must not be positive