/** * @test */ public function theShutdownMethodRunsCloseOnAllRegisteredBackends() { $mockBackend1 = $this->getMock(\TYPO3\Flow\Log\Backend\BackendInterface::class, array('open', 'append', 'close')); $mockBackend1->expects($this->once())->method('close'); $mockBackend2 = $this->getMock(\TYPO3\Flow\Log\Backend\BackendInterface::class, array('open', 'append', 'close')); $mockBackend2->expects($this->once())->method('close'); $logger = new \TYPO3\Flow\Log\Logger(); $logger->addBackend($mockBackend1); $logger->addBackend($mockBackend2); $logger->shutdownObject(); }
/** * 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); }