respect-validation/tests/integration/rules/keyValue_3.phpt
Henrique Moody cc20a442a1
Apply "SlevomatCodingStandard.TypeHints.DeclareStrictTypes"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:11:12 +01:00

26 lines
599 B
PHP

--CREDITS--
Edson Lima <dddwebdeveloper@gmail.com>
Henrique Moody <henriquemoody@gmail.com>
--FILE--
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Respect\Validation\Exceptions\AllOfException;
use Respect\Validation\Validator as v;
$data = [
'password' => 'shazam',
'password_confirmation' => 'batman',
];
try {
v::keyValue('password', 'equals', 'password_confirmation')->assert($data);
} catch (AllOfException $e) {
echo $e->getMessage();
}
?>
--EXPECT--
All of the required rules must pass for `{ "password": "shazam", "password_confirmation": "batman" }`