Example #1
0
 public function testTransform()
 {
     $template = new Template();
     $template->setDir('tests/PSX/Template/files');
     $template->set('foo.htm');
     $this->assertEquals('tests/PSX/Template/files', $template->getDir());
     $this->assertEquals('foo.htm', $template->get());
     $this->assertTrue($template->hasFile());
     $this->assertTrue($template->isFileAvailable());
     $this->assertFalse($template->isAbsoluteFile());
     $this->assertEquals('tests/PSX/Template/files/foo.htm', $template->getFile());
     $template->assign('foo', 'bar');
     $content = $template->transform();
     $this->assertEquals('Hello bar', $content);
 }