Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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)));
 }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
 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"));
 }