public function testDisplay_this() { file_put_contents($this->file, '<?php echo $lorem ?> <?php echo $var_this ?>'); $finder = $this->getMockFinder(); $finder->expects($this->once())->method("findPath")->with($this->equalTo("search.ext"))->will($this->returnValue($this->file)); $this->expectOutputString("Lorem Ipsum"); $tpl = new \r8\Template\PHP($finder, "search.ext"); $tpl->set("lorem", "Lorem"); $tpl->set("this", "Ipsum"); $tpl->display(); }
/** * Builds a new PHP file template * * @param mixed $file The file this tempalte should load * @return \r8\Template\PHP */ public function php($file) { $tpl = new \r8\Template\PHP($this->finder, $file); $tpl->import($this->getValues()); return $tpl; }