Skip to content
Permalink
Browse files

Adds a test to prove existence of bug with Cell::render() when dealin…

…g with cache & different templates
  • Loading branch information...
garethellis36 committed Sep 27, 2016
1 parent ca96417 commit ed513cd1df318c5eabc21e0575a04024396c30b1
@@ -466,4 +466,25 @@ public function testCachedRenderSimpleCustomTemplateViewBuilder()
Cache::delete('celltest');
Cache::drop('default');
}
/**
* Test that when the cell cache is enabled, the cell action is only invoke the first
* time the cell is rendered
*
* @return void
*/
public function testACachedViewCellReRendersWhenGivenADifferentTemplate()
{
Cache::config('default', [
'className' => 'File',
'path' => CACHE,
]);
$cell = $this->View->cell('Articles::customTemplateViewBuilder', [], ['cache' => ['key' => 'celltest']]);
$result = $cell->render("alternate_teaser_list");
$result2 = $cell->render("not_the_alternate_teaser_list");
$this->assertContains('This is the alternate template', $result);
$this->assertContains('This is NOT the alternate template', $result2);
Cache::delete('celltest');
Cache::drop('default');
}
}
@@ -0,0 +1 @@
<h1>This is NOT the alternate template</h1>

0 comments on commit ed513cd

Please sign in to comment.
You can’t perform that action at this time.