Test/Form/Widget/Button/Submit.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 3 / 3 totaltotal 92.8% 26 / 28 CC 1 SCAR 1.3
CC
1
Cov
94%
gui_type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Test/Form/Widget/Button/Image.pm ↑ Summary Test/Page/Text.pm »
1 package CGI::Test::Form::Widget::Button::Submit;
2 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 ##################################################################
5 # $Id: Submit.pm 411 2011-09-26 11:19:30Z nohuhu@nohuhu.org $
6 # $Name: cgi-test_0-104_t1 $
7 ##################################################################
8 #
9 # Copyright (c) 2001, Raphael Manfredi
10 #
11 # You may redistribute only under the terms of the Artistic License,
12 # as specified in the README file that comes with the distribution.
13 #
14  
15 14 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 #
18 # This class models a FORM submit button.
19 #
20  
21 14 ▶use base qw(CGI::Test::Form::Widget::Button);
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #
24 # Attribute access
25 #
26  
27 sub gui_type
28 0 ▶{
Subroutine gui_type: not called CC=1 SCAR=6.9
Pod documented
29 0 return "submit button";
30 }
31  
32 #
33 # ->press
34 #
35 # Press button.
36 # Has immediate effect: a GET/POST request is issued.
37 #
38 # Returns resulting CGI::Test::Page.
39 #
40 sub press
41 19 ▶{
Subroutine press: called CC=1 SCAR=0.0
Pod documented
42 19 my $this = shift;
43 19 $this->set_is_pressed(1);
44 19 return $this->form->submit;
45 }
46  
47 #
48 # Button predicates
49 #
50  
51 sub is_submit
52 48 ▶{
Subroutine is_submit: called CC=1 SCAR=0.0
Pod documented
53 48 return 1;
54 }
55  
56 14 1;
57  
58 =head1 NAME
59  
60 CGI::Test::Form::Widget::Button::Submit - A submit button
61  
62 =head1 SYNOPSIS
63  
64 # Inherits from CGI::Test::Form::Widget::Button
65 # $form is a CGI::Test::Form
66  
67 my $send = $form->submit_by_name("send");
68 my $answer = $send->press;
69  
70 =head1 DESCRIPTION
71  
72 This class models a submit button.
73 Pressing it immediately triggers an HTTP request, as defined by the form.
74  
75 The interface is the same as the one described in
76 L<CGI::Test::Form::Widget::Button>.
77  
78 =head1 AUTHORS
79  
80 The original author is Raphael Manfredi.
81  
82 Steven Hilton was long time maintainer of this module.
83  
84 Current maintainer is Alexander Tokarev F<E<lt>tokarev@cpan.orgE<gt>>.
85  
86 =head1 SEE ALSO
87  
88 CGI::Test::Form::Widget::Button(3).
89  
90 =cut
91  
« Test/Form/Widget/Button/Image.pm ↑ Summary Test/Page/Text.pm »