Exemplo n.º 1
0
 public function testRegisterErrorHandler()
 {
     $writer = new MockWriter();
     $this->logger->addWriter($writer);
     $this->assertTrue(Logger::registerErrorHandler($this->logger));
     // check for single error handler instance
     $this->assertFalse(Logger::registerErrorHandler($this->logger));
     // generate a warning
     echo $test;
     Logger::unregisterErrorHandler();
     $this->assertEquals($writer->events[0]['message'], 'Undefined variable: test');
 }