* @author Kornel LesiƄski * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @version SVN: $Id: TalOmitTagTest.php 888 2010-06-08 09:48:33Z kornel $ * @link http://phptal.org/ */ class TalOmitTagTest extends PHPTAL_TestCase { function testSimple() { $tpl = $this->newPHPTAL('input/tal-omit-tag.01.html'); $res = normalize_html($tpl->execute()); $exp = normalize_html_file('output/tal-omit-tag.01.html'); $this->assertEquals($exp, $res); } function testWithCondition() { $tpl = $this->newPHPTAL('input/tal-omit-tag.02.html'); $res = normalize_html($tpl->execute()); $exp = normalize_html_file('output/tal-omit-tag.02.html'); $this->assertEquals($exp, $res); } private $call_count; function callCount() { $this->call_count++; } function testCalledOnlyOnce() { $this->call_count=0; $tpl = $this->newPHPTAL(); $tpl->setSource('

'); $tpl->test = $this; $tpl->execute(); $this->assertEquals(1, $this->call_count); $tpl->execute(); $this->assertEquals(2, $this->call_count); } function testNestedConditions() { $this->call_count=0; $tpl = $this->newPHPTAL(); $tpl->setSource('abcdefghijk'); $this->assertEquals('abcdefghijk', $tpl->execute()); } }