Exemple #1
0
 /**
  * Returns a new instance of TemplateRenderer
  */
 public function __construct()
 {
     $this->twigFileLoader = new \Twig_Loader_Filesystem();
     $this->twigSystemLoader = new \Twig_Loader_Array(['template' => load_system_template('TemplateClass')]);
     $this->twigEnvironment = new \Twig_Environment(new \Twig_Loader_Chain([$this->twigSystemLoader, $this->twigFileLoader]), $this->environmentOptions);
     $this->twigStringEnvironment = new \Twig_Environment(new \Twig_Loader_Chain([$this->twigSystemLoader, $this->twigFileLoader, new \Twig_Loader_String()]), $this->environmentOptions);
     $this->registerFilters();
     $this->registerFunctions();
     $this->registerCorePaths();
 }
Exemple #2
0
 public function testLoadSystemTemplateReturnsCorrectContent()
 {
     $content = load_system_template('Example');
     $this->assertEquals('{# This is just an example. Do not use. #}', $content);
 }