File Coverage

blib/lib/Apache2/ASP/Mock/Connection.pm
Criterion Covered Total %
statement 9 18 50.0
branch 0 2 0.0
condition n/a
subroutine 3 7 42.8
pod 2 3 66.6
total 14 30 46.6


line stmt bran cond sub pod time code
1              
2             package Apache2::ASP::Mock::Connection;
3              
4 23     23   99 use strict;
  23         31  
  23         616  
5 23     23   86 use warnings 'all';
  23         26  
  23         635  
6 23     23   7986 use Apache2::ASP::Mock::ClientSocket;
  23         40  
  23         3209  
7              
8              
9             #==============================================================================
10             sub new
11             {
12 0     0 0   my ($class) = @_;
13            
14 0           my $s = bless {
15             aborted => 0,
16             }, $class;
17 0           $s->{client_socket} = Apache2::ASP::Mock::ClientSocket->new( connection => $s );
18            
19 0           return $s;
20             }# end new()
21              
22              
23             #==============================================================================
24             sub aborted
25             {
26 0     0 1   my ($s) = shift;
27 0 0         @_ ? $s->{aborted} = shift : $s->{aborted};
28             }# end aborted()
29              
30              
31             #==============================================================================
32             sub client_socket
33             {
34 0     0 1   $_[0]->{client_socket};
35             }# end client_socket()
36              
37              
38             #==============================================================================
39             sub DESTROY
40             {
41 0     0     my $s = shift;
42 0           undef(%$s);
43             }# end DESTROY()
44              
45             1;# return true:
46              
47              
48             =pod
49              
50             =head1 NAME
51              
52             Apache2::ASP::Mock::Connection - Mimics the Apache2::Connection object
53              
54             =head1 SYNOPSIS
55              
56             my $conn = $Response->context->connection;
57             unless( $conn->aborted )
58             {
59             $conn->client_socket->close();
60             }# end unless()
61              
62             =head1 DESCRIPTION
63              
64             This package mimics the L object in a normal mod_perl2 environment,
65             and is used by L.
66              
67             =head1 PUBLIC PROPERTIES
68              
69             =head2 aborted
70              
71             Read-only.
72              
73             Returns true or false, depending on whether the current connection is aborted.
74              
75             =head2 client_socket
76              
77             Returns the current L object.
78            
79             =head1 BUGS
80            
81             It's possible that some bugs have found their way into this release.
82            
83             Use RT L to submit bug reports.
84            
85             =head1 HOMEPAGE
86            
87             Please visit the Apache2::ASP homepage at L to see examples
88             of Apache2::ASP in action.
89              
90             =head1 AUTHOR
91              
92             John Drago
93              
94             =head1 COPYRIGHT
95              
96             Copyright 2008 John Drago. All rights reserved.
97              
98             =head1 LICENSE
99              
100             This software is Free software and is licensed under the same terms as perl itself.
101              
102             =cut
103              
104