summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/php/var1.t
blob: 22a9f3d4803bdb4cbd4735f8e896212198b4e08f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;

plan tests => 2, need_php;

## var1.php source:
## <?php echo $variable?>
##
## result should be variable echoed back.

my $page = '/php/var1.php';
my $data = "blah1+blah2+FOO";
#my @data = (variable => $data);
my $expected = $data;
$expected =~ s/\+/ /g;

## POST
#my $return = POST_BODY $page, \@data;
#print STDERR "\n\n$return\n\n";
#ok $return eq $expected;
my $return = POST_BODY $page, content => "variable=$data";
ok t_cmp($return,
         $expected,
         "POST request for $page, content=\"variable=$data\""
        );

## GET
$return = GET_BODY "$page?variable=$data";
ok t_cmp($return,
         $expected,
         "GET request for $page?variable=$data"
        );