Environment/Plugin/Apache2/Apache2/Request.pm

filter: Statementstmt 64.2% 18 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 50.0% 1 / 2 totaltotal 60.5% 23 / 38 CC 2 SCAR 9.4
CC
2
Cov
60%
params
6.0
new
2.0
BEGIN
1.0
CRAP 2.6
« Environment/Plugin/Dump.pm ↑ Summary Environment.pm »
1 package Test::Environment::Plugin::Apache2::Apache2::Request;
2  
3 1 our $VERSION = "0.07";
4  
5 1 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 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 our $VERSION = "0.07";
27  
28 1 ▶use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 ▶use base 'Class::Accessor::Fast';
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32  
33 =head1 PROPERTIES
34  
35 req_rec
36  
37 =cut
38  
39 1 __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 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
54 0 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 1 *param = *params;
67  
68 0 ▶sub params {
Subroutine params: not called CC=2 SCAR=17.9
Pod undocumented
69 0 my $self = shift;
70 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
71 0 my $param_name = shift;
72 0 return $self->_params->{$param_name};
73 }
74 0 return $self->_params;
75 }
76  
77 1 1;
78  
79 __END__
« Environment/Plugin/Dump.pm ↑ Summary Environment.pm »