TYPO3 CMS  TYPO3_6-2
AbstractProcessorTest.php
Go to the documentation of this file.
1 <?php
3 
23 
29  $invalidConfiguration = array(
30  'foo' => 'bar'
31  );
32  $processor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Tests\\Unit\\Log\\Fixtures\\ProcessorFixture', $invalidConfiguration);
33  }
34 
38  public function loggerExecutesProcessors() {
39  $logger = new \TYPO3\CMS\Core\Log\Logger('test.core.log');
40  $writer = new \TYPO3\CMS\Core\Log\Writer\NullWriter();
42  $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('dummy', $level, 'message');
43  $processor = $this->getMock('\\TYPO3\\CMS\\Core\\Log\\Processor\\ProcessorInterface', array('processLogRecord'));
44  $processor->expects($this->once())->method('processLogRecord')->willReturn($logRecord);
45 
46  $logger->addWriter($level, $writer);
47  $logger->addProcessor($level, $processor);
48  $logger->warning('test');
49  }
50 }