/** * @param string $logLevel * @param int $logLevelCode * @dataProvider dataProviderProcessSuccess * @return void */ public function testProcessSuccess($logLevel, $logLevelCode) { $this->logger->expects($this->any())->method('pushHandler')->willReturnSelf(); $this->logger->expects($this->once())->method('pushProcessor')->with([$this->messageProcessor, 'setExtra'])->willReturnSelf(); $this->consoleHandler->expects($this->once())->method('setLevel')->willReturnSelf($logLevelCode); $this->consoleHandler->expects($this->once())->method('setFormatter')->with($this->messageFormatter)->willReturnSelf(); $this->fileHandler->expects($this->once())->method('setLevel')->willReturnSelf(); $this->fileHandler->expects($this->once())->method('setFormatter')->with($this->messageFormatter)->willReturnSelf(); $this->manager->process($logLevel); }
/** * @return void */ public function testHandleError() { $extra = ['mode' => 'application mode']; $record = ['message' => $this->message, 'level' => $this->recordLevel, 'extra' => $extra]; $this->fileHandler->setLevel($this->handlerLevel); $result = $this->fileHandler->handle($record); $this->assertFalse($result); }