2019-04-05 17:33:34 +02:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
require 'vendor/autoload.php';
|
|
|
|
|
|
|
|
use Respect\Validation\Validator as v;
|
|
|
|
|
2023-04-01 07:20:05 +02:00
|
|
|
exceptionMessage(static fn() => v::domain()->check('batman'));
|
|
|
|
exceptionMessage(static fn() => v::not(v::domain())->check('r--w.com'));
|
|
|
|
exceptionFullMessage(static fn() => v::domain()->assert('p-éz-.kk'));
|
|
|
|
exceptionFullMessage(static fn() => v::not(v::domain())->assert('github.com'));
|
2019-04-05 17:33:34 +02:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
2024-03-07 00:42:19 +01:00
|
|
|
"batman" must be a valid domain
|
2019-04-05 17:33:34 +02:00
|
|
|
"r--w.com" must not be a valid domain
|
|
|
|
- "p-éz-.kk" must be a valid domain
|
|
|
|
- "github.com" must not be a valid domain
|