respect-validation/tests/integration/not_without_recursion.phpt

26 lines
521 B
Plaintext
Raw Normal View History

--CREDITS--
Henrique Moody <henriquemoody@gmail.com>
2015-10-08 07:39:17 +02:00
--TEST--
not() with recursion should update mode of its children
2015-10-08 07:39:17 +02:00
--FILE--
<?php
declare(strict_types=1);
2015-10-08 07:39:17 +02:00
require 'vendor/autoload.php';
2015-10-23 12:46:12 +02:00
use Respect\Validation\Exceptions\ValidationException;
2015-10-18 03:44:47 +02:00
use Respect\Validation\Validator;
2015-10-08 07:39:17 +02:00
try {
$validator = Validator::not(
Validator::intVal()->positive()
);
$validator->check(2);
2015-10-23 12:46:12 +02:00
} catch (ValidationException $exception) {
echo $exception->getMessage() . PHP_EOL;
2015-10-08 07:39:17 +02:00
}
?>
--EXPECT--
2015-10-08 07:39:17 +02:00
2 must not be positive