/** * @runInSeparateProcess */ public function testHandleTemplate() { $file = __DIR__ . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'error.phtml'; $provider = new ServiceProvider(); $provider->setConfig(array('templates' => array('template_error' => $file))); $handler = new DefaultExceptionHandler($provider); $e = new \Exception(); $response = $handler->handle($e); $view = $provider->getView(); $view->message = 'Internal Server Error'; $result = $view->renderFile($file); $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $body = $response->getBody(); $body->rewind(); $this->assertEquals($result, $body->getContents()); }
/** * Set config * * @param mixed $option * @param mixed $value */ public function setConfig($option, $value = null) { $this->serviceProvider->setConfig($option, $value); }