コード例 #1
0
 public function testCreateDefault()
 {
     $loader = ErrorPageLoader::createDefault();
     try {
         $contentDefault = $loader->loadContentByStatusCode(0);
         $this->assertTrue(is_resource($contentDefault), 'The content is not resource');
         $this->assertContains('<h1>Oops! An Error Occurred</h1>', stream_get_contents($contentDefault));
     } finally {
         fclose($contentDefault);
     }
 }
コード例 #2
0
 /**
  * @param ArrayNodeDefinition $rootNode
  */
 private function addExceptionHandlerSection(ArrayNodeDefinition $rootNode)
 {
     $rootNode->children()->arrayNode('exception_handler')->addDefaultsIfNotSet()->children()->arrayNode('error_page')->addDefaultsIfNotSet()->children()->scalarNode('template_path')->info('Path of the error page templates')->defaultValue(ErrorPageLoader::getDefaultTemplatePath())->end()->end()->end()->end()->end()->end();
 }
コード例 #3
0
ファイル: Container.php プロジェクト: syrma-php/web-container
 /**
  * @return ErrorPageLoaderInterface
  */
 public function getErrorPageLoader()
 {
     if (null === $this->errorPageLoader) {
         $this->errorPageLoader = ErrorPageLoader::createDefault();
     }
     return $this->errorPageLoader;
 }
コード例 #4
0
 protected function createHandler()
 {
     return new DefaultExceptionHandler(new ZendPsr7Factory(), ErrorPageLoader::createDefault());
 }
コード例 #5
0
 public function testDefalut()
 {
     $config = $this->createConfig(array());
     $this->assertEquals(array('server' => array('default' => SwooleServer::isAvaiable() ? 'swoole' : null, 'swoole' => array('enabled' => false, 'transformer' => array('use_server_request' => true, 'response_buffer' => 8096), 'options' => array())), 'request_handler' => array('default' => 'symfony'), 'exception_handler' => array('error_page' => array('template_path' => ErrorPageLoader::getDefaultTemplatePath())), 'executor' => array('default' => 'default', 'executorList' => array('default' => array('server' => ExecutorFactory::USE_DEFAULT_KEY, 'request_handler' => ExecutorFactory::USE_DEFAULT_KEY, 'exception_handler_service' => 'syrma.web_container.exception_handler', 'parent_service' => 'syrma.web_container.executor.abstract', 'use_factory' => true)))), $config);
 }