/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { if (class_exists('\\TYPO3\\Flow\\Log\\Logger') === false) { $this->markTestSkipped('Class \\TYPO3\\Flow\\Log\\Logger not found'); } $be = new \TYPO3\Flow\Log\Backend\FileBackend(); $be->setSeverityThreshold(LOG_ERR); $be->setLogFileURL('flow.log'); $log = new \TYPO3\Flow\Log\Logger(); $log->addBackend($be); $this->object = new \Aimeos\MW\Logger\Flow($log); }
/** * @test */ public function appendIgnoresMessagesAboveTheSeverityThreshold() { $logFileUrl = vfsStream::url('testDirectory') . '/test.log'; $backend = new \TYPO3\Flow\Log\Backend\FileBackend(array('logFileUrl' => $logFileUrl)); $backend->setSeverityThreshold(LOG_EMERG); $backend->open(); $backend->append('foo', LOG_INFO); $this->assertSame(0, vfsStreamWrapper::getRoot()->getChild('test.log')->size()); }