Exemplo n.º 1
0
 public function testNonRenderMethodIsPassedThrough()
 {
     $realTwig = Mockery::mock('Twig_Template');
     $realTwig->shouldReceive('testing')->once();
     $env = Mockery::mock('Twig_Environment', ['loadTemplate' => $realTwig]);
     $twig = new LazyTwig($env, new Context(), 'path/to/template/file');
     $twig->testing();
 }
 /**
  * Render the template with context data and automatically add to response
  *
  * @param array $context
  *
  * @return string
  */
 public function render(array $context = [])
 {
     $rendered = parent::render($context);
     if ($this->response) {
         $this->response->setBody($rendered);
     }
     return $rendered;
 }