3 package Test::WWW::Mechanize::CGI;
7 use base 'Test::WWW::Mechanize';
11 use HTTP::Request::AsCGI;
24 my ( $self, $request ) = @_;
26 $self->cookie_jar->add_cookie_header($request) if $self->cookie_jar;
28 my $c = HTTP::Request::AsCGI->new($request)->setup;
30 my $response = $c->restore->response;
32 $response->header( 'Content-Base', $request->uri );
33 $response->request($request);
34 $self->cookie_jar->extract_cookies($response) if $self->cookie_jar;
43 use Test::More tests => 3;
45 my $mech = Test::WWW::Mechanize::CGI->new;
48 CGI::initialize_globals();
53 $q->start_html('Hello World'),
54 $q->h1('Hello World'),
58 $mech->get_ok('http://localhost/');
59 $mech->title_is('Hello World');
60 $mech->content_contains('Hello World');