Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libwww-mechanize-perl / libwww-mechanize-perl-1.34 / t / tick.t
1 #!perl -Tw
2
3 use warnings;
4 use strict;
5 use Test::More tests => 5;
6 use URI::file;
7
8 delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};  # Placates taint-unsafe Cwd.pm in 5.6.1
9 use_ok( 'WWW::Mechanize' );
10
11 my $mech = WWW::Mechanize->new( cookie_jar => undef );
12 isa_ok( $mech, 'WWW::Mechanize' );
13
14 my $uri = URI::file->new_abs( 't/tick.html' )->as_string;
15 $mech->get( $uri );
16 ok( $mech->success, $uri );
17
18 $mech->form_number( 1 );
19 $mech->tick('foo','hello');
20 $mech->tick('foo','bye');
21 $mech->untick('foo','hello');
22
23 my $form = $mech->form_number(1);
24 isa_ok( $form, 'HTML::Form' );
25
26 my $reqstring = $form->click->as_string;
27
28 my $wanted = <<'EOT';
29 POST http://localhost/
30 Content-Length: 21
31 Content-Type: application/x-www-form-urlencoded
32
33 foo=bye&submit=Submit
34 EOT
35
36 is( $reqstring, $wanted, 'Proper posting' );
37