From 678406d54d1b59523634b7b310a561744108f2db Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 18 Nov 2010 08:40:22 -0800 Subject: [PATCH] Fix tests that were using var. --- t/Asset/Asset.t | 8 ++++---- t/Asset/Template.t | 6 +++--- t/Asset/dispatch.t | 4 ++-- t/Macro/AdminBar.t | 2 +- t/Macro/AdminText.t | 4 ++-- t/Macro/EditableToggle.t | 4 ++-- t/Macro/FilePump.t | 2 +- t/Session/Http.t | 2 +- t/Workflow/Activity/DeleteExpiredSessions.t | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index d2cd41e99..cad051656 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -506,10 +506,10 @@ TODO: { ################################################################ $session->user({ userId => 3 }); -$session->var->switchAdminOff; +$session->switchAdminOff; is($rootAsset->addMissing('/nowhereMan'), undef, q{addMissing doesn't return anything unless user is in Admin Mode}); -$session->var->switchAdminOn; +$session->switchAdminOn; my $addMissing = $rootAsset->addMissing('/nowhereMan'); ok($addMissing, 'addMissing returns some output when in Admin Mode'); @@ -858,7 +858,7 @@ $clippedAsset->cut; is $trashedAsset->get('state'), 'trash', 'checkView setup: trashed an asset'; is $clippedAsset->get('state'), 'clipboard', '... clipped an asset'; -$session->var->switchAdminOff; +$session->switchAdminOff; $session->http->setRedirectLocation(''); $session->http->setStatus(200, 'OK'); @@ -871,7 +871,7 @@ $clippedAsset->checkView(); is $session->http->getStatus, 410, '... status set to 410 for cut asset'; is $session->http->getRedirectLocation, '', '... no redirect set'; -$session->var->switchAdminOn; +$session->switchAdminOn; $session->http->setStatus(200, 'OK'); is $trashedAsset->checkView(), 'chunked', '... returns "chunked" when admin is on for trashed asset'; is $session->http->getRedirectLocation, $trashedAsset->getUrl('func=manageTrash'), '... trashed asset sets redirect to manageTrash'; diff --git a/t/Asset/Template.t b/t/Asset/Template.t index 5b14a634a..093b4d6a4 100644 --- a/t/Asset/Template.t +++ b/t/Asset/Template.t @@ -161,7 +161,7 @@ $template3rev->purgeRevision(); ## Check how templates in the trash and clipboard are handled. $session->asset($importNode); -$session->var->switchAdminOff; +$session->switchAdminOff; my $trashTemplate = $importNode->addChild({ className => "WebGUI::Asset::Template", @@ -175,7 +175,7 @@ is($trashTemplate->process, '', 'process: returns nothing when the template is i $trashTemplate->cut; is($trashTemplate->process, '', '... returns nothing when the template is in the trash, and admin mode is off'); -$session->var->switchAdminOn; +$session->switchAdminOn; $trashTemplate->trash; is($trashTemplate->process, 'Template in trash', '... returns message when the template is in the trash, and admin mode is on'); @@ -183,7 +183,7 @@ is($trashTemplate->process, 'Template in trash', '... returns message when the t $trashTemplate->cut; is($trashTemplate->process, 'Template in clipboard', '... returns message when the template is in the trash, and admin mode is on'); -$session->var->switchAdminOff; +$session->switchAdminOff; # Check error logging for bad templates diff --git a/t/Asset/dispatch.t b/t/Asset/dispatch.t index 1bcebf8f1..877a2ee42 100644 --- a/t/Asset/dispatch.t +++ b/t/Asset/dispatch.t @@ -124,12 +124,12 @@ isnt( $output, "www_view", "?func= dispatch cancelled because of unhandled fragm $td->cut(); $output = $td->dispatch(); is $output, undef, 'dispatch returns undef when trying to access an asset that is not published, and admin is not on'; -$session->var->switchAdminOn; +$session->switchAdminOn; $output = $td->dispatch(); is $output, 'www_view', 'when admin is on, the asset can be accessed'; $td->publish(); -$session->var->switchAdminOff; +$session->switchAdminOff; $output = $td->dispatch(); is $output, 'www_view', 'asset state restored for next tests'; diff --git a/t/Macro/AdminBar.t b/t/Macro/AdminBar.t index 0fe5dc525..d92e5e43a 100644 --- a/t/Macro/AdminBar.t +++ b/t/Macro/AdminBar.t @@ -24,7 +24,7 @@ plan tests => 2; my $output; $output = WebGUI::Macro::AdminBar::process($session); is($output, undef, 'AdminBar returns undef unless admin is on'); -$session->var->switchAdminOn; +$session->switchAdminOn; $output = WebGUI::Macro::AdminBar::process($session); ok($output, 'AdminBar returns something when admin is on'); diff --git a/t/Macro/AdminText.t b/t/Macro/AdminText.t index 2a1ffb457..5fa5dc192 100644 --- a/t/Macro/AdminText.t +++ b/t/Macro/AdminText.t @@ -31,7 +31,7 @@ $session->user({userId => 3}); $output = WebGUI::Macro::AdminText::process($session, 'admin'); is($output, '', 'user is admin, not in admin mode'); -$session->var->switchAdminOn; +$session->switchAdminOn; $output = WebGUI::Macro::AdminText::process($session, 'admin'); is($output, 'admin', 'admin in admin mode'); @@ -41,6 +41,6 @@ is($output, '', 'null text'); $output = WebGUI::Macro::AdminText::process($session); is($output, undef, 'undef text'); -$session->var->switchAdminOff; +$session->switchAdminOff; $output = WebGUI::Macro::AdminText::process($session, 'admin'); is($output, '', 'user is admin, not in admin mode'); diff --git a/t/Macro/EditableToggle.t b/t/Macro/EditableToggle.t index 8366b028b..8b1ba3778 100644 --- a/t/Macro/EditableToggle.t +++ b/t/Macro/EditableToggle.t @@ -197,12 +197,12 @@ foreach my $testSet (@testSets) { $session->user({userId=>$testSet->{userId}}); $session->asset($testSet->{asset}); if ($testSet->{adminStatus} eq 'off') { - $session->var->switchAdminOff(); + $session->switchAdminOff(); $testSet->{label} = $testSet->{onText} || $i18n->get(516); $testSet->{url} = $session->url->page('op=switchOnAdmin'), } elsif ($testSet->{adminStatus} eq 'on') { - $session->var->switchAdminOn(); + $session->switchAdminOn(); $testSet->{label} = $testSet->{offText} || $i18n->get(517); $testSet->{url} = $session->url->page('op=switchOffAdmin'), } diff --git a/t/Macro/FilePump.t b/t/Macro/FilePump.t index ed3584467..63775194b 100644 --- a/t/Macro/FilePump.t +++ b/t/Macro/FilePump.t @@ -92,7 +92,7 @@ is( '... check illegal file type access returns empty string' ); -$session->var->switchAdminOn(); +$session->switchAdminOn(); is( WebGUI::Macro::FilePump::process($session, 'test bundle', 'JS'), sprintf(qq|\n\n|, diff --git a/t/Session/Http.t b/t/Session/Http.t index 92237691d..3f5684e11 100644 --- a/t/Session/Http.t +++ b/t/Session/Http.t @@ -32,7 +32,7 @@ use Test::MockObject::Extends; ##try and implement the mod_perl cookie handling code. $http = Test::MockObject::Extends->new($http); my $cookieName = $session->config->getCookieName; -my $varId = $session->var->getId(); +my $varId = $session->getId(); $http->mock( getCookies => sub { return {$cookieName => $varId} } ); diff --git a/t/Workflow/Activity/DeleteExpiredSessions.t b/t/Workflow/Activity/DeleteExpiredSessions.t index 8355e426d..b9378c94b 100644 --- a/t/Workflow/Activity/DeleteExpiredSessions.t +++ b/t/Workflow/Activity/DeleteExpiredSessions.t @@ -93,7 +93,7 @@ is ($newSessionCount, $sessionCount+2, 'two of the sessions were deleted'); is ($newScratchCount, $scratchCount+2, 'scratch from both sessions cleaned up'); foreach my $testSession (@sessions) { - $testSession->var->end; + $testSession->end; $testSession->close; }