コード例 #1
0
 public function testExceptionHandler()
 {
     $this->assertEquals(0, $this->errorHandler->getStats()->getExceptionsHandled());
     $this->errorHandler->register(false, true, false);
     $this->errorHandler->handleException(new \Exception('test'));
     $this->errorHandler->unregister();
     $this->assertEquals(1, $this->errorHandler->getStats()->getExceptionsHandled());
 }
コード例 #2
0
 public function testTestHandlerHandlesException()
 {
     $this->assertFalse($this->testHandler->getExceptionHandled());
     $this->errorHandler->handleException(new \Exception());
     $this->assertTrue($this->testHandler->getExceptionHandled());
 }
コード例 #3
0
 /** {@inheritdoc} */
 public function handleException(\Exception $exception, Metadata $metadata = null)
 {
     $metadata = $this->addDefaultCategory($metadata);
     $this->errorHandler->handleException($exception, $metadata);
 }
コード例 #4
0
 public function testCallbackExecuted()
 {
     $this->assertFalse($this->testProcessor->getCallbackExecuted());
     $this->errorHandler->handleException(new \Exception());
     $this->assertTrue($this->testProcessor->getCallbackExecuted());
 }