Ejemplo n.º 1
0
 public function testCreateNextFile()
 {
     $helper = new LogFileHelper();
     $testdir = __DIR__ . '/testlogs';
     $helper->createNextLogFile($testdir);
     $expectedFileName = 'log ' . date('d-m-Y') . ' (2).log';
     $this->assertTrue(file_exists($testdir . '/' . $expectedFileName));
 }
Ejemplo n.º 2
0
 public function setup()
 {
     $logger = new \Monolog\Logger('WildPHP');
     $logger->pushHandler(new ErrorLogHandler());
     $this->logger = $logger;
     $logFileHelper = new LogFileHelper();
     $logFileHelper->setLogger($this);
     $logFileHelper->createNewLogFile();
     $this->getEventEmitter()->on('irc.data.in', function (IrcDataObject $object) {
         $this->debug('<< ' . $object->getIrcMessage());
     });
     $this->getEventEmitter()->on('irc.data.out', function (IrcDataObject $object) {
         $this->debug('>> ' . $object->getIrcMessage());
     });
 }