public function testIncludeParent() { $tpl = new Dwoo_Template_File(TEST_DIRECTORY . '/resources/subfolder/inctest.html'); $tpl->forceCompilation(); $this->assertEquals("43", $this->dwoo->get($tpl, array(), $this->compiler)); }
public function testTemplateFile() { $tpl = new Dwoo_Template_File(TEST_DIRECTORY . '/resources/test.html'); $tpl->forceCompilation(); $this->assertEquals("12", $this->dwoo->get($tpl, array('foo' => 1, 'bar' => 2))); }
public function testSubTemplatesMultiInc() { $tpl = new Dwoo_Template_File(TEST_DIRECTORY . '/resources/templateUsage.html'); $tpl->forceCompilation(); $this->assertEquals("\n" . 'noparamoutput' . "\n", $this->dwoo->get($tpl, array(), $this->compiler)); $this->assertEquals("\n" . 'noparamoutput' . "\n", $this->dwoo->get($tpl, array(), $this->compiler)); }
public function testExtendsMultiple() { $tpl = new Dwoo_Template_File(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'extend2.html'); $tpl->forceCompilation(); $this->assertThat($this->dwoo->get($tpl, array('foo' => 'bar'), $this->compiler), new DwooConstraintStringEquals("foo\nchild1\ntoplevelContent1child2\nbar\nFOObartoplevelContent2\nbaz")); }