Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Add tests for including a inheritaded template using a relative path …
Browse files Browse the repository at this point in the history
…to the parent
  • Loading branch information
Stephan Hoffmann committed Mar 22, 2018
1 parent 2cab895 commit 4d5813b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/BlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ public function testExtendsWithNestedBlocks2()
'));
}

public function testIncludeExtended()
{
$tpl = new TemplateFile(dirname(__FILE__) . '/resources/include_extended/including.html');
$tpl->forceCompilation();

$this->assertEquals($this->dwoo->get($tpl, array(), $this->compiler),"<html>
<div>Extended</div>
</html>
");

}

public function testIf()
{
$tpl = new TemplateString('{if "BAR"==reverse($foo|reverse|upper)}true{/if}');
Expand Down
4 changes: 4 additions & 0 deletions tests/resources/include_extended/extended/extended.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{extends "../root.html"}
{block "content"}
Extended
{/block}
3 changes: 3 additions & 0 deletions tests/resources/include_extended/including.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<html>
{include "tests/resources/include_extended/extended/extended.html"}
</html>
1 change: 1 addition & 0 deletions tests/resources/include_extended/root.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>{block "content"}Root{/block}</div>

0 comments on commit 4d5813b

Please sign in to comment.