| 1 | # test the query() method |
| 2 | |
| 3 | use Test::More 'no_plan'; |
| 4 | use CGI; |
| 5 | |
| 6 | # Include the test hierarchy |
| 7 | use lib 't/lib'; |
| 8 | |
| 9 | use TestApp14; |
| 10 | |
| 11 | # Prevent output to STDOUT |
| 12 | $ENV{CGI_APP_RETURN_ONLY} = 1; |
| 13 | |
| 14 | # Test query() |
| 15 | { |
| 16 | my $cgi = CGI->new('message=hello'); |
| 17 | my $ta_obj = TestApp14->new(QUERY => $cgi); |
| 18 | my $output = $ta_obj->run(); |
| 19 | |
| 20 | like($output, qr/---->hello<----/); |
| 21 | |
| 22 | my $cgi2 = CGI->new('message=goodbye'); |
| 23 | $ta_obj->query($cgi2); |
| 24 | $output = $ta_obj->run(); |
| 25 | |
| 26 | like($output, qr/---->goodbye<----/); |
| 27 | } |