respect-validation/tests/integration/rules/stringVal.phpt
Henrique Moody 7f1eef6bf7
Improve several validation messages
I'm not a native English speaker, and the same goes for many
contributors from this library. Because of that, some messages just
don't sound very good, so I updated a lot of them.
2024-12-05 23:37:42 +01:00

15 lines
No EOL
476 B
PHP

--FILE--
<?php
require 'vendor/autoload.php';
exceptionMessage(static fn() => v::stringVal()->assert([]));
exceptionMessage(static fn() => v::not(v::stringVal())->assert(true));
exceptionFullMessage(static fn() => v::stringVal()->assert(new stdClass()));
exceptionFullMessage(static fn() => v::not(v::stringVal())->assert(42));
?>
--EXPECT--
`[]` must be a string value
`true` must not be a string value
- `stdClass {}` must be a string value
- 42 must not be a string value