Another Article method change.

This commit is contained in:
Colin Kuskie 2010-02-04 15:22:23 -08:00
parent 6702f076f1
commit c1a3030191
2 changed files with 3 additions and 3 deletions

View file

@ -403,7 +403,7 @@ sub view {
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
if (!$self->session->var->isAdminOn && $self->cacheTimeout > 10 && !$self->session->form->process("overrideTemplateId") &&
!$self->session->form->process($self->paginateVar) && !$self->session->form->process("makePrintable")) {
eval{$cache->set("view_".$self->getId, $out, $self->get("cacheTimeout"))};
eval{$cache->set("view_".$self->getId, $out, $self->cacheTimeout)};
}
return $out;
}

View file

@ -118,12 +118,12 @@ my $output = $article->view;
isnt ($output, "", 'view method returns something');
# Lets see if caching works
my $cachedOutput = WebGUI::Cache->new($session, 'view_'.$article->getId)->get;
my $cachedOutput = $session->cache->get('view_'.$article->getId);
is ($output, $cachedOutput, 'view method caches output');
# Lets see if the purgeCache method works
$article->purgeCache;
$cachedOutput = WebGUI::Cache->new($session, 'view_'.$article->getId)->get; # Check cache post purge
$cachedOutput = $session->cache->get('view_'.$article->getId); # Check cache post purge
isnt ($output, $cachedOutput, 'purgeCache method deletes cache');