예제 #1
0
 public function testSendErrorsWithErrors()
 {
     $client = $this->getClientMock();
     $client->expects($this->once())->method('sendReport');
     $error = $this->getErrorMock();
     $errorHandler = $this->getErrorHandlerMock();
     $errorHandler->expects($this->once())->method('getErrors')->will($this->returnValue(array($error)));
     $report = $this->getReportMock();
     $reportFactory = $this->getReportFactoryMock();
     $reportFactory->expects($this->once())->method('createFromErrors')->will($this->returnValue($report));
     $shutdownHandler = new ShutdownHandler($client, $errorHandler, $reportFactory);
     $shutdownHandler->sendErrors();
 }
예제 #2
0
파일: Monitor.php 프로젝트: helthe/monitor
 /**
  * Registers a shutdown handler.
  *
  * @param Client       $client
  * @param ErrorHandler $handler
  * @param array        $application
  *
  * @return ShutdownHandler
  */
 private static function registerShutdownHandler(Client $client, ErrorHandler $handler, array $application)
 {
     return ShutdownHandler::register($client, $handler, new ReportFactory(self::createApplication($application), Request::createFromGlobals(), Server::createFromGlobals()));
 }