/
FakeReq.pm
72 lines (63 loc) · 1.92 KB
/
FakeReq.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package Kynetx::FakeReq;
#
# Copyright 2007-2009, Kynetx Inc. All rights reserved.
#
# This Software is an unpublished, proprietary work of Kynetx Inc.
# Your access to it does not grant you any rights, including, but not
# limited to, the right to install, execute, copy, transcribe, reverse
# engineer, or transmit it by any means. Use of this Software is
# governed by the terms of a Software License Agreement transmitted
# separately.
#
# Any reproduction, redistribution, or reverse engineering of the
# Software not in accordance with the License Agreement is expressly
# prohibited by law, and may result in severe civil and criminal
# penalties. Violators will be prosecuted to the maximum extent
# possible.
#
# Without limiting the foregoing, copying or reproduction of the
# Software to any other server or location for further reproduction or
# redistribution is expressly prohibited, unless such reproduction or
# redistribution is expressly permitted by the License Agreement
# accompanying this Software.
#
# The Software is warranted, if at all, only according to the terms of
# the License Agreement. Except as warranted in the License Agreement,
# Kynetx Inc. hereby disclaims all warranties and conditions
# with regard to the software, including all warranties and conditions
# of merchantability, whether express, implied or statutory, fitness
# for a particular purpose, title and non-infringement.
#
use strict;
use warnings;
#
# This package simulates a mod_perl request object for testing
#
#constructor
sub new {
my ($class) = @_;
my $self = {};
$self->{'add'} = sub {return 1};
bless $self, $class;
return $self;
}
# fake methods for requests
sub subprocess_env {
return 0;
}
sub content_type {
return 0;
}
sub headers_in {
return {
'Cookie' => 'SESSION_ID=7e9ea0ff190e0f883aaae0c3e64166c0'
};
}
sub headers_out {
my ($self) = @_;
return $self;
}
sub add {
return 1;
}
1;