respect-validation/tests/integration/not_with_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

33 lines
746 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\NestedValidationException;
use Respect\Validation\Validator;
try {
$validator = Validator::not(
Validator::not(
Validator::not(
Validator::not(
Validator::not(
Validator::intVal()->positive()
)
)
)
)
);
$validator->check(2);
} catch (NestedValidationException $exception) {
echo $exception->getFullMessage().PHP_EOL;
}
?>
--EXPECT--
- These rules must not pass for 2