File: get_input_data.t

package info (click to toggle)
libdata-formvalidator-perl 4.66-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 588 kB
  • ctags: 127
  • sloc: perl: 2,756; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use Test::More qw/no_plan/;

use Data::FormValidator;

{
    my $results = Data::FormValidator->check({},{});
    is_deeply($results->get_input_data, {}, 'get_input_data works for empty hashref' ); 
}

use CGI;
my $q = CGI->new( { key => 'value' });
my $results = Data::FormValidator->check($q,{});

is_deeply($results->get_input_data, $q, 'get_input_data works for CGI object' ); 

{
    my $href = $results->get_input_data(as_hashref => 1);
    is_deeply($href , { key => 'value' },  'get_input_data( as_hashref => 1 ) works for CGI object' ); 
}