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');
 }
 /**
  * @dataProvider provideConnectorMethodsOptionsSets
  */
 public function testOptionCallsConnectorMethod($option, $method, $value, $isArgument = true)
 {
     $expectCall = $this->connector->expects($this->once())->method($method);
     if ($isArgument) {
         $expectCall->with($value);
     }
     new PHPConsoleHandler(array($option => $value), $this->connector);
 }
 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());
 }