2016-03-04 17:46:07 +01:00
|
|
|
--TEST--
|
|
|
|
PhpLabel rule exception should not be thrown for valid inputs
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-02-09 11:44:33 +01:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2016-03-04 17:46:07 +01:00
|
|
|
require 'vendor/autoload.php';
|
|
|
|
|
|
|
|
use Respect\Validation\Validator as v;
|
|
|
|
|
2023-04-01 07:20:05 +02:00
|
|
|
exceptionMessage(static fn() => v::phpLabel()->check('f o o'));
|
|
|
|
exceptionMessage(static fn() => v::not(v::phpLabel())->check('correctOne'));
|
|
|
|
exceptionFullMessage(static fn() => v::phpLabel()->assert('0wner'));
|
|
|
|
exceptionFullMessage(static fn() => v::not(v::phpLabel())->assert('Respect'));
|
2016-03-04 17:46:07 +01:00
|
|
|
?>
|
2018-12-19 18:05:58 +01:00
|
|
|
--EXPECT--
|
2018-09-07 17:17:53 +02:00
|
|
|
"f o o" must be a valid PHP label
|
|
|
|
"correctOne" must not be a valid PHP label
|
|
|
|
- "0wner" must be a valid PHP label
|
|
|
|
- "Respect" must not be a valid PHP label
|