PseudoRequest shouldn't clobber Apache2::Cookies if the package already exists; mock requests are sometimes useful under mod_perl and this is a bit of a gotcha
This commit is contained in:
parent
db3058c0b7
commit
225df67d1f
2 changed files with 19 additions and 14 deletions
|
|
@ -19,21 +19,25 @@ use strict;
|
|||
use Test::MockObject;
|
||||
|
||||
BEGIN {
|
||||
Test::MockObject->fake_module(
|
||||
'Apache2::Cookie',
|
||||
new => sub {
|
||||
my $class = shift;
|
||||
my $self = Test::MockObject->new;
|
||||
$self->set_isa($class);
|
||||
$self->set_true(qw(expires domain bake));
|
||||
},
|
||||
);
|
||||
if( do { no strict 'refs'; ! exists ${"Apache2::"}{"Cookie::"} } ) {
|
||||
Test::MockObject->fake_module(
|
||||
'Apache2::Cookie',
|
||||
new => sub {
|
||||
my $class = shift;
|
||||
my $self = Test::MockObject->new;
|
||||
$self->set_isa($class);
|
||||
$self->set_true(qw(expires domain bake));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Test::MockObject->fake_module('APR::Request::Apache2',
|
||||
handle => sub {
|
||||
return $_[1];
|
||||
},
|
||||
);
|
||||
if( do { no strict 'refs'; ! exists ${"APR::"}{"Request::"} } ) {
|
||||
Test::MockObject->fake_module('APR::Request::Apache2',
|
||||
handle => sub {
|
||||
return $_[1];
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
use WebGUI::PseudoRequest::Headers;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue