From f69df9b7ca57854db0c91c3eeea96e988a666b65 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 14 Aug 2009 01:38:44 +0000 Subject: [PATCH] Enable tests to work around HTTP cookie fetching. Finally! --- t/lib/WebGUI/Test.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 96728b352..349fd3cb6 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -1,9 +1,5 @@ package WebGUI::Test; -use strict; -use warnings; -use Clone qw/clone/; - =head1 LEGAL ------------------------------------------------------------------- @@ -26,6 +22,12 @@ Utility module for making testing in WebGUI easier. =cut + +use strict; +use warnings; +use Clone qw/clone/; +use Test::MockObject; + our ( $SESSION, $WEBGUI_ROOT, $CONFIG_FILE, $WEBGUI_LIB, $WEBGUI_TEST_COLLATERAL ); use Config qw[]; @@ -66,8 +68,16 @@ my $smtpdPid; my $smtpdStream; my $smtpdSelect; +my $mocker; + BEGIN { + $mocker = Test::MockObject->fake_module( + 'APR::Request::Apache2', + handle => sub { return bless {}, 'APR::Request::Apache2'; }, + jar => sub { return { }; }, + ); + STDERR->autoflush(1); $CONFIG_FILE = $ENV{ WEBGUI_CONFIG };