This repository has been archived by the owner on Apr 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
short form of {section} attributes did not work smarty-php/smarty#428
- Loading branch information
Uwe Tews
committed
Mar 21, 2018
1 parent
711af1c
commit 6e98c2d
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.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,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')); | ||
} | ||
|
||
|
||
} |
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 @@ | ||
dummy |
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 @@ | ||
{section name=bar loop=$foo}{$foo[bar.index]}{sectionelse} else {/section} |
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 @@ | ||
{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section} |
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 @@ | ||
dummy |