respect-validation/tests/integration/issue-1244.phpt
Olumide Samson 029fa7fe73
Remove "Key" prefix from KeyException message
Most Validation errors are sent to Users/Visitors or Clients and as such
might not need to know it was a Key their inputs are being validated
upon.

Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2020-10-04 11:42:51 +02:00

23 lines
404 B
PHP

--FILE--
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Respect\Validation\Exceptions\NestedValidationException;
use Respect\Validation\Validator as v;
try {
v::key('firstname', v::notBlank()->setName('First Name'))->assert([]);
} catch (NestedValidationException $e) {
print_r($e->getMessages());
}
?>
--EXPECTF--
Array
(
[First Name] => First Name must be present
)