line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Environment::Plugin::Apache2::Apache2::Request; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "0.07"; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
1; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Apache2::Request; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Test::Environment::Plugin::Apache2::Apache2::Request - mock Apache2::Request for Test::Environment |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Will populate Apache2::Request namespace with fake methods that can be used for |
19
|
|
|
|
|
|
|
testing. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
1406
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
24
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
29
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our $VERSION = "0.07"; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
813
|
use URI; |
|
1
|
|
|
|
|
4246
|
|
|
1
|
|
|
|
|
25
|
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
5
|
use base 'Class::Accessor::Fast'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
269
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 PROPERTIES |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
req_rec |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw{ |
40
|
|
|
|
|
|
|
req_rec |
41
|
|
|
|
|
|
|
_params |
42
|
|
|
|
|
|
|
}); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHODS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 new() |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Object constructor. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub new { |
54
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
55
|
0
|
|
|
|
|
|
my $req_rec = shift; |
56
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new({ |
57
|
|
|
|
|
|
|
'req_rec' => $req_rec, |
58
|
|
|
|
|
|
|
@_, |
59
|
|
|
|
|
|
|
}); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
$self->{'_params'} = { URI->new($req_rec->unparsed_uri)->query_form }; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
*param = *params; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub params { |
69
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
70
|
0
|
0
|
|
|
|
|
if (@_) { |
71
|
0
|
|
|
|
|
|
my $param_name = shift; |
72
|
0
|
|
|
|
|
|
return $self->_params->{$param_name}; |
73
|
|
|
|
|
|
|
} |
74
|
0
|
|
|
|
|
|
return $self->_params; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |