Mock the Session::Http->getCookies method so that neither it nor
setCookie will be called.
This commit is contained in:
parent
7c8fde9aa6
commit
c3a2e71cd1
1 changed files with 8 additions and 2 deletions
|
|
@ -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');
|
||||
|
||||
####################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue