Skip to content

Commit 9eb0c75

Browse files
Layout Renderer - Added unit test with multiple view rendered calls using same section
1 parent 0550852 commit 9eb0c75

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/system/View/ViewTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,18 @@ public function testRenderLayoutExtendsCorrectly()
276276
$this->assertContains($expected, $view->render('extend'));
277277
}
278278

279+
public function testRenderLayoutExtendsMultipleCalls()
280+
{
281+
$view = new View($this->config, $this->viewsDir, $this->loader);
282+
283+
$view->setVar('testString', 'Hello World');
284+
$expected = "<p>Open</p>\n<h1>Hello World</h1>\n<p>Hello World</p>";
285+
286+
$view->render('extend');
287+
288+
$this->assertContains($expected, $view->render('extend'));
289+
}
290+
279291
public function testRenderLayoutMakesDataAvailableToBoth()
280292
{
281293
$view = new View($this->config, $this->viewsDir, $this->loader);

0 commit comments

Comments
 (0)