#!/usr/bin/perl -w
my
(
$file
,
$path
) = fileparse($0);
require
"${path}config.pl"
;
my
$ua
= new LWP::UserAgent::FramesReady;
isa_ok(
$ua
,
'LWP::UserAgent::FramesReady'
);
$netloc
=
$net::httpserver
;
$script
=
$net::cgidir
.
"/test"
;
$url
= new URI::URL(
"http://$netloc$script?query"
);
isa_ok(
$url
,
'URI::URL'
);
my
$request
= new HTTP::Request(
'GET'
,
$url
);
isa_ok(
$request
,
'HTTP::Request'
);
print
"GET $url\n\n"
;
my
$response
=
$ua
->request(
$request
,
undef
,
undef
);
my
$str
=
$response
->as_string;
like(
$str
,
qr/^REQUEST_METHOD=GET$/
m,
"Expected response content"
);
print
"$str\n"
;
is(
$response
->is_success, 1,
"Good HTTP response"
);
like(
$str
,
qr/^QUERY_STRING=query$/
m,
"Expected query response"
);
$dummy
=
$net::httpserver
;
$dummy
=
$net::cgidir
;