forked from smarty-php/smarty
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added regression test for smarty-php#639
Modified include inline unit test to catch evaluation error.
- Loading branch information
Showing
7 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/UnitTests/TemplateSource/TagTests/Include/templates/inline_string_include.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{include "string:include-inline" inline} | ||
{include "string:include-inline\n" inline} |
38 changes: 38 additions & 0 deletions
38
tests/UnitTests/TemplateSource/_Issues/639/IncludeBlockToInlineIssue639Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Smarty PHPunit tests compiler errors | ||
* | ||
* @package PHPunit | ||
* @author Uwe Tews | ||
*/ | ||
|
||
/** | ||
* class for compiler tests | ||
* | ||
* @runTestsInSeparateProcess | ||
* @preserveGlobalState disabled | ||
* @backupStaticAttributes enabled | ||
* | ||
* Switching from block to inline include crashes render | ||
*/ | ||
class IncludeBlockToInlineIssue639Test extends PHPUnit_Smarty | ||
{ | ||
public function setUp() | ||
{ | ||
$this->setUpSmarty(dirname(__FILE__)); | ||
} | ||
|
||
public function testInit() | ||
{ | ||
$this->cleanDirs(); | ||
} | ||
|
||
public function testInlineFirst() | ||
{ | ||
$this->assertEquals("include-inline\ninclude-regular\n", $this->smarty->fetch('001_inline_first.tpl')); | ||
} | ||
public function testInlineLast() | ||
{ | ||
$this->assertEquals("include-regular\ninclude-inline\n", $this->smarty->fetch('002_inline_last.tpl')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore anything in here, but keep this directory | ||
* |
2 changes: 2 additions & 0 deletions
2
tests/UnitTests/TemplateSource/_Issues/639/templates/001_inline_first.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{include "string:include-inline\n" inline} | ||
{include "string:include-regular\n"} |
2 changes: 2 additions & 0 deletions
2
tests/UnitTests/TemplateSource/_Issues/639/templates/002_inline_last.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{include "string:include-regular\n"} | ||
{include "string:include-inline\n" inline} |
2 changes: 2 additions & 0 deletions
2
tests/UnitTests/TemplateSource/_Issues/639/templates_c/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore anything in here, but keep this directory | ||
* |