Exemplo n.º 1
0
 public function testHandleShutdown()
 {
     $this->errorHandler->handleShutdown(E_ERROR, 'test', 'test', 1, '2');
     $data = $this->storage->getData();
     $this->assertEquals(1, count($data), 'The stored data count is not 1');
     $this->assertTrue(isset($data['2']), 'No stored data');
     $this->errorHandler->handleShutdown(E_ERROR, 'test', 'test', 1, '2');
     $this->assertEquals(1, count($data), 'Saving debug data twice');
 }
Exemplo n.º 2
0
 public function testHandleShutdown()
 {
     $this->errorHandler->handleShutdown(E_ERROR, 'test', 'test', 1, '2');
     $this->assertEquals(1, count($this->logger->loggedMessages), 'The logged messages count is not 1');
     $fields = $this->logger->loggedMessages[0]->getFields();
     $this->assertSame(ErrorHandlerHelper::E_ERROR_DESCRIPTION, $fields['type'], 'The log message type does not match');
     $this->assertSame('2', $fields['error_id'], 'The log ID does not match');
     $this->assertSame(LOG_ERR, $this->logger->loggedMessages[0]->getPriority(), 'The log level does not match');
 }