mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Update
This commit is contained in:
@@ -16,8 +16,6 @@ class CompileSectionTest extends PHPUnit_Smarty
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
$this->smarty->setErrorReporting(error_reporting() & ~(E_NOTICE | E_USER_NOTICE));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,12 +29,14 @@ class CompileSectionTest extends PHPUnit_Smarty
|
||||
public function testSection1()
|
||||
{
|
||||
$tpl = $this->smarty->createTemplate('section1.tpl');
|
||||
$tpl->assign('foo', array(0,1,2,3,4,5,6,7,8,9));
|
||||
$this->assertEquals("0123456789", $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
public function testSection2()
|
||||
{
|
||||
$tpl = $this->smarty->createTemplate('section2.tpl');
|
||||
$tpl->assign('foo', array(0,1,2,3,4,5,6,7,8,9));
|
||||
$this->assertEquals("0123456789", $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
@@ -49,19 +49,22 @@ class CompileSectionTest extends PHPUnit_Smarty
|
||||
public function testSection4()
|
||||
{
|
||||
$tpl = $this->smarty->createTemplate('section4.tpl');
|
||||
$tpl->assign('foo', array(0,1,2,3,4,5,6,7,8,9));
|
||||
$this->assertEquals("0123456789", $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
public function testSection6()
|
||||
{
|
||||
$tpl = $this->smarty->createTemplate('section6.tpl');
|
||||
$tpl->assign('foo', array(0,1,2,3,4,5,6,7,8,9));
|
||||
$this->assertEquals("0123456789total10", $this->smarty->fetch($tpl));
|
||||
}
|
||||
/*
|
||||
|
||||
public function testSection7()
|
||||
{
|
||||
$tpl = $this->smarty->createTemplate('section7.tpl');
|
||||
$tpl->assign('foo', array(0,1,2,3,4,5,6,7,8,9));
|
||||
$this->assertEquals("011223344556677889910", $this->smarty->fetch($tpl));
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{/section}
|
||||
{section name=bar loop=$foo}{$foo[bar]}{/section}
|
@@ -1 +1 @@
|
||||
{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo start=$i}{$foo[bar]}{sectionelse} else {/section}
|
||||
{section name=bar loop=$foo start=$i}{$foo[bar]}{sectionelse} else {/section}
|
@@ -1 +1 @@
|
||||
{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}
|
||||
{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}
|
@@ -1 +1 @@
|
||||
{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}total{$smarty.section.bar.total}
|
||||
{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}total{$smarty.section.bar.total}
|
@@ -1 +1 @@
|
||||
{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$smarty.section.bar.index}{$smarty.section.bar.iteration}{sectionelse} else {/section}
|
||||
{section name=bar loop=$foo}{$smarty.section.bar.index}{$smarty.section.bar.iteration}{sectionelse} else {/section}
|
Reference in New Issue
Block a user