|
#!/usr/bin/env perl
email
FV_eq_with
) ;
my $result = Data::FormValidator->check(
{ email => 'a' , email_confirm => 'b' },
{
required => [ qw( email email_confirm ) ],
constraint_methods => {
email => [ email(), FV_eq_with( 'email_confirm' ) ],
},
msgs => {
constraints => {
email => 'Invalid Email Address' ,
eq_with => 'Must match confirmation'
},
} } );
like(
$result ->msgs->{email},
qr/Email Address/ ,
"custom message for email() works"
);
like(
$result ->msgs->{email},
qr/Must Match/ i,
"custom message for FV_eq_with() works"
);
done_testing();
|