Add ARM files
[dh-make-perl] / dev / arm / libwww-mechanize-perl / libwww-mechanize-perl-1.34 / t / tick.t
diff --git a/dev/arm/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/tick.t b/dev/arm/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/tick.t
new file mode 100644 (file)
index 0000000..cec5d6f
--- /dev/null
@@ -0,0 +1,37 @@
+#!perl -Tw
+
+use warnings;
+use strict;
+use Test::More tests => 5;
+use URI::file;
+
+delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};  # Placates taint-unsafe Cwd.pm in 5.6.1
+use_ok( 'WWW::Mechanize' );
+
+my $mech = WWW::Mechanize->new( cookie_jar => undef );
+isa_ok( $mech, 'WWW::Mechanize' );
+
+my $uri = URI::file->new_abs( 't/tick.html' )->as_string;
+$mech->get( $uri );
+ok( $mech->success, $uri );
+
+$mech->form_number( 1 );
+$mech->tick('foo','hello');
+$mech->tick('foo','bye');
+$mech->untick('foo','hello');
+
+my $form = $mech->form_number(1);
+isa_ok( $form, 'HTML::Form' );
+
+my $reqstring = $form->click->as_string;
+
+my $wanted = <<'EOT';
+POST http://localhost/
+Content-Length: 21
+Content-Type: application/x-www-form-urlencoded
+
+foo=bye&submit=Submit
+EOT
+
+is( $reqstring, $wanted, 'Proper posting' );
+