diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php index 6d9fc6ad..d8e253b8 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php @@ -28,38 +28,37 @@ class CompileSectionTest extends PHPUnit_Smarty */ public function testSection1() { - $tpl = $this->smarty->createTemplate('eval:{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{/section}'); + $tpl = $this->smarty->createTemplate('section1.tpl'); $this->assertEquals("0123456789", $this->smarty->fetch($tpl)); } public function testSection2() { - $tpl = $this->smarty->createTemplate('eval:{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}'); + $tpl = $this->smarty->createTemplate('section2.tpl'); $this->assertEquals("0123456789", $this->smarty->fetch($tpl)); } public function testSection3() { - $this->smarty->setErrorReporting(error_reporting() & ~(E_NOTICE | E_USER_NOTICE)); - $tpl = $this->smarty->createTemplate('eval:{section name=bar loop=$foo}{$foo[bar]}{sectionelse}else{/section}'); + $tpl = $this->smarty->createTemplate('section3.tpl'); $this->assertEquals("else", $this->smarty->fetch($tpl)); } public function testSection4() { - $tpl = $this->smarty->createTemplate('eval:{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{sectionelse} else {/section}'); + $tpl = $this->smarty->createTemplate('section4.tpl'); $this->assertEquals("0123456789", $this->smarty->fetch($tpl)); } public function testSection6() { - $tpl = $this->smarty->createTemplate('eval:{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}'); + $tpl = $this->smarty->createTemplate('section6.tpl'); $this->assertEquals("0123456789total10", $this->smarty->fetch($tpl)); } public function testSection7() { - $tpl = $this->smarty->createTemplate('eval:{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}'); + $tpl = $this->smarty->createTemplate('section7.tpl'); $this->assertEquals("011223344556677889910", $this->smarty->fetch($tpl)); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section1.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section1.tpl new file mode 100644 index 00000000..09ca6cad --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section1.tpl @@ -0,0 +1 @@ +{assign var=foo value=[0,1,2,3,4,5,6,7,8,9]}{section name=bar loop=$foo}{$foo[bar]}{/section} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section2.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section2.tpl new file mode 100644 index 00000000..b8335b40 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section2.tpl @@ -0,0 +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} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section3.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section3.tpl new file mode 100644 index 00000000..3dc172ea --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section3.tpl @@ -0,0 +1 @@ +{section name=bar loop=$foo}{$foo[bar]}{sectionelse}else{/section} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section4.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section4.tpl new file mode 100644 index 00000000..3915094c --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section4.tpl @@ -0,0 +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} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section6.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section6.tpl new file mode 100644 index 00000000..aa625fd6 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section6.tpl @@ -0,0 +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} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates/section7.tpl b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section7.tpl new file mode 100644 index 00000000..3cf8c782 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Section/templates/section7.tpl @@ -0,0 +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} \ No newline at end of file