From 1c08796d6c87eb5bc3f0e261621b0fb04a407100 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 11 Jul 2011 13:01:58 -0700 Subject: [PATCH] Keywords fixes to prevent leaks. --- t/Asset/Wobject/EventManagementSystem.t | 1 + t/Asset/processTemplate.t | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t index cc6b3d15d..d6de3906b 100644 --- a/t/Asset/Wobject/EventManagementSystem.t +++ b/t/Asset/Wobject/EventManagementSystem.t @@ -346,6 +346,7 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } ); 'eventSubmissionTemplateId' => ignore(), 'submittedLocationsList' => ignore(), 'tickets_loop' => \@ticketArray, + keywords => ignore(), }, "www_printRemainingTickets: template variables valid" ); diff --git a/t/Asset/processTemplate.t b/t/Asset/processTemplate.t index 745e1b707..00843f083 100644 --- a/t/Asset/processTemplate.t +++ b/t/Asset/processTemplate.t @@ -24,17 +24,13 @@ plan tests => 1; my $session = WebGUI::Test->session; -##Set the maximum assets to 5 -WebGUI::Test->originalConfig('maximumAssets'); -$session->config->set('maximumAssets', 5); - my $rootAsset = WebGUI::Asset->getRoot($session); my $versionTag = WebGUI::VersionTag->getWorking($session); WebGUI::Test->addToCleanup($versionTag); -$rootAsset->addRevision({keywords => 'one,two,three,four'}); +my $snippet = $rootAsset->addChild({keywords => 'one,two,three,four', className=>'WebGUI::Asset::Snippet'}); $versionTag->commit; -$rootAsset = $rootAsset->cloneFromDb; +$snippet = $snippet->cloneFromDb; ##Override the user function style template so we can examine its output easily #1234567890123456789012# @@ -47,7 +43,7 @@ $templateMock->mock('process', sub { $templateVars = clone($_[1]); } ); { WebGUI::Test->mockAssetId($templateId, $templateMock); - $rootAsset->processTemplate({}, $templateId); + $snippet->processTemplate({}, $templateId); use WebGUI::Keyword; my $keywords = WebGUI::Keyword::string2list($templateVars->{keywords}); cmp_bag($keywords, [qw/one two three four/], 'Keywords are available when running processTemplate');