/** * @return string * @throws \Exception */ private function getResponseBody() { /** @var \stdClass $view_vars */ $view_vars = $this->controller->view; $response_body = $this->controller->getBody(); if ($this->controller->hasViewEnabled()) { $view = $this->config['controller'] . '/' . $this->config['action'] . '.twig'; try { $response_body = $this->controller->getTwig()->render($view, (array) $view_vars); } catch (\Exception $e) { throw $e; } } if ($this->controller->hasLayoutEnabled()) { $response_body = $this->templateCheck($this->controller, $response_body, (array) $view_vars); } return $response_body; }
public function testGetSetBody() { $this->controller->setBody('garrr! there be mermaids!'); $this->assertEquals('garrr! there be mermaids!', $this->controller->getBody()); }