Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added regression test for smarty-php/smarty#639 #652

Open
wants to merge 1 commit into
base: bugfix/inline_include_string_template_crash
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -330,6 +330,6 @@ public function dataTestSpacing()
*/
public function testInlineStringInclude()
{
$this->assertEquals('include-inline', $this->smarty->fetch('inline_string_include.tpl'));
$this->assertEquals("include-inline\n", $this->smarty->fetch('inline_string_include.tpl'));
}
}
@@ -1 +1 @@
{include "string:include-inline" inline}
{include "string:include-inline\n" inline}
@@ -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'));
}
}
2 changes: 2 additions & 0 deletions tests/UnitTests/TemplateSource/_Issues/639/cache/.gitignore
@@ -0,0 +1,2 @@
# Ignore anything in here, but keep this directory
*
@@ -0,0 +1,2 @@
{include "string:include-inline\n" inline}
{include "string:include-regular\n"}
@@ -0,0 +1,2 @@
{include "string:include-regular\n"}
{include "string:include-inline\n" inline}
@@ -0,0 +1,2 @@
# Ignore anything in here, but keep this directory
*