diff --git a/t/Session/Scratch.t b/t/Session/Scratch.t index cf8c228d2..a82ee51c8 100644 --- a/t/Session/Scratch.t +++ b/t/Session/Scratch.t @@ -119,9 +119,11 @@ is($sessionBank[2]->scratch->deleteNameByValue('falseValue',''), 1, "deleteNameB END { $session->scratch->deleteAll; - foreach my $wgSess ($newSession, @sessionBank, $session) { + foreach my $wgSess ($newSession, @sessionBank) { if (defined $wgSess and ref $wgSess eq 'WebGUI::Session') { + diag "Closing session"; $wgSess->scratch->deleteAll; + $wgSess->var->end; $wgSess->close; } } diff --git a/t/Workflow/Activity/DeleteExpiredSessions.t b/t/Workflow/Activity/DeleteExpiredSessions.t index f6bef7ecd..aaac04e61 100644 --- a/t/Workflow/Activity/DeleteExpiredSessions.t +++ b/t/Workflow/Activity/DeleteExpiredSessions.t @@ -19,10 +19,13 @@ use WebGUI::Workflow::Activity::DeleteExpiredSessions; use Test::More; -plan tests => 4; # increment this value for each test you create +plan tests => 5; # increment this value for each test you create my $session = WebGUI::Test->session; +my $activity = WebGUI::Workflow::Activity::DeleteExpiredSessions->create($session); +$activity->execute(); ##Clear out any old sessions that might interfere with this test; + my $origSessionTimeout = $session->setting->get('sessionTimeout'); my $sessionCount = $session->db->quickScalar('select count(*) from userSession'); @@ -52,8 +55,8 @@ my $newScratchCount = $session->db->quickScalar('select count(*) from userSessio is ($newSessionCount, $sessionCount+4, 'all new sessions created correctly'); is ($newScratchCount, $scratchCount+2, 'two of the new sessions have scratch entries'); -my $activity = WebGUI::Workflow::Activity::DeleteExpiredSessions->create($session); -$activity->execute(); +my $returnValue = $activity->execute(); +is ($returnValue, 'complete', 'DeleteExpiredSessions completed'); $newSessionCount = $session->db->quickScalar('select count(*) from userSession'); $newScratchCount = $session->db->quickScalar('select count(*) from userSessionScratch');