Пример #1
0
 public function testRender()
 {
     $view = new View();
     $view->name = 'Tlumx';
     $path = sys_get_temp_dir();
     $file = @tempnam($path, 'tlumx_tmp_view_');
     file_put_contents($file . '.phtml', 'Hello, <?php echo $this->name; ?>!');
     $view->setTemplatesPath($path);
     $template = ltrim(substr($file, strlen($path)), DIRECTORY_SEPARATOR);
     $this->assertEquals("Hello, Tlumx!", $view->render($template));
     unlink($file);
 }