Mock the Session::Http->getCookies method so that neither it nor

setCookie will be called.
This commit is contained in:
Colin Kuskie 2006-11-06 00:50:34 +00:00
parent 7c8fde9aa6
commit c3a2e71cd1

View file

@ -27,11 +27,17 @@ my $num_tests = 71;
plan tests => $num_tests;
my $session = WebGUI::Test->session;
# put your tests here
my $http = $session->http;
use Test::MockObject::Extends;
$http = Test::MockObject::Extends->new($http);
my $cookieName = $session->config->getCookieName;
my $varId = $session->var->getId();
$http->mock( getCookies => sub { return {$cookieName => $varId} } );
isa_ok($http, 'WebGUI::Session::Http', 'session has correct object type');
####################################################