Example #1
0
 public function testGlobalExists()
 {
     $extension = new TestExtension1();
     $this->getWiser()->getEnvironment()->addExtension($extension);
     $view = new View(__DIR__ . '/Fixture/variables/global.html.php');
     $view->setWiser($this->getWiser());
     $output = $view->render();
     $this->assertEquals('global', $output);
 }
Example #2
0
 /**
  * @param $file
  *
  * @return View
  */
 public function getView($file)
 {
     $templates = $this->findTemplates($file);
     $fileName = array_keys(iterator_to_array($templates));
     $fileName = array_shift($fileName);
     if (!isset($this->views[$fileName])) {
         $view = new View($fileName);
         $view->setWiser($this);
         $this->views[$fileName] = $view;
     }
     return $this->views[$fileName];
 }