Example #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();
 }