Example #1
0
 /**
  * Tests whether an OverflowException (not a
  * LoggingExceptions\OverflowException) is raised when there is an attempt
  * to register a Logger instance that conflicts with the existing one.
  *
  * @runInSeparateProcess
  * @preserveGlobalState disabled
  */
 public function testLoggerConflict()
 {
     Exception::registerLogger(self::$_logger);
     /* It's OK to make this call a second time if the file, email
        recipient, and automatic email settings match. */
     $logger = new \Logger(self::$_logger->getFile(), self::$_logger->getEmailRecipient());
     Exception::registerLogger($logger);
     $this->assertThrows('OverflowException', array('LoggingExceptions\\Exception', 'registerLogger'), array($logger, false));
     $this->assertThrows('OverflowException', array('LoggingExceptions\\Exception', 'registerLogger'), array(new \Logger(self::_createTempFile())));
     $this->assertThrows('OverflowException', array('LoggingExceptions\\Exception', 'registerLogger'), array(new \Logger(self::$_logFile, '*****@*****.**')));
     $this->assertThrows('OverflowException', array('LoggingExceptions\\Exception', 'registerLogger'), array(new \Logger(self::_createTempFile(), '*****@*****.**')));
 }