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

Commit

Permalink
short form of {section} attributes did not work smarty-php/smarty#428
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Tews committed Mar 21, 2018
1 parent 711af1c commit 6e98c2d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Smarty PHPunit tests compiler errors
*
* @package PHPunit
* @author Uwe Tews
*/

/**
* class for compiler tests
*
* @runTestsInSeparateProcess
* @preserveGlobalState disabled
* @backupStaticAttributes enabled
*
* Short syntax of section properties did not work
*/
class SectionPropertiesShortSyntaxIssue428Test extends PHPUnit_Smarty
{
public function setUp()
{
$this->setUpSmarty(dirname(__FILE__));
}

public function testInit()
{
$this->cleanDirs();
}

public function testSection_001()
{
$this->smarty->assign('foo', array('a', 'b', 'c'));
$this->assertEquals('abc', $this->smarty->fetch('001_section.tpl'));
}
public function testSection_002()
{
$this->smarty->assign('foo', array('a', 'b', 'c'));
$this->assertEquals('abc', $this->smarty->fetch('002_section.tpl'));
}


}
1 change: 1 addition & 0 deletions UnitTests/TemplateSource/_Issues/428/cache/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{section name=bar loop=$foo}{$foo[bar.index]}{sectionelse} else {/section}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}
1 change: 1 addition & 0 deletions UnitTests/TemplateSource/_Issues/428/templates_c/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy

0 comments on commit 6e98c2d

Please sign in to comment.