示例#1
0
 public function testSetErrorsHandlerLevel()
 {
     $this->handler->setErrorsHandlerLevel(E_ALL ^ E_USER_NOTICE);
     $this->handler->start();
     trigger_error('hehe', E_USER_NOTICE);
     $this->connector->expects($this->never())->method('sendMessage');
 }
 public function testRecursiveExceptionsHandlingLimit()
 {
     $handler = $this->handler;
     set_exception_handler(function () use($handler) {
         $handler->handleException(new \Exception());
     });
     $this->connector->getErrorsDispatcher()->ignoreRepeatedSource = false;
     $this->connector->expects($this->exactly(\PhpConsole\Handler::ERRORS_RECURSION_LIMIT))->method('sendMessage');
     $this->handler->start();
     $this->handler->handleException(new \Exception());
 }