Example #1
0
 public function testHandleSuccessWithoutBubble()
 {
     $extra = ['mode' => 'application mode'];
     $record = ['message' => $this->message, 'level' => $this->recordLevel, 'extra' => $extra];
     $this->fileHandler->setLevel($this->handlerLevel);
     $this->fileHandler->setBubble(false);
     $file = 'file/path/file.log';
     $this->filesystem->expects($this->any())->method('filePutContents')->willReturn(1);
     $this->filesystem->expects($this->any())->method('getRealPath')->willReturnMap([[$file, false], ['file/path', false], ['file', '/existing_path/file']]);
     $this->filesystem->expects($this->once())->method('createDirectory')->willReturn(true);
     $this->config->expects($this->any())->method('getOption')->with('log_file')->willReturn($file);
     $result = $this->fileHandler->handle($record);
     $this->assertTrue($result);
 }