Пример #1
0
 function it_should_handling_the_log_as_bubble(ConsoleOutputInterface $output, ConsoleOutputInterface $errorOutput)
 {
     $output->writeln(Argument::any())->willReturn(null);
     $output->getVerbosity()->shouldBeCalled()->willReturn(OutputInterface::VERBOSITY_DEBUG);
     $output->write('<info>[16:21:54] app.INFO:</info> My info message' . "\n")->shouldBeCalled();
     $this->beConstructedWith(null, false);
     $this->setOutput($output);
     $infoRecord = array('message' => 'My info message', 'context' => array(), 'level' => Logger::INFO, 'level_name' => Logger::getLevelName(Logger::INFO), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), 'extra' => array());
     $this->handle($infoRecord)->shouldReturn(true);
     $output->getErrorOutput()->willReturn($errorOutput)->shouldBeCalled();
     $errorOutput->write('<error>[16:21:54] app.ERROR:</error> My error message' . "\n")->shouldBeCalled();
     $errorRecord = array('message' => 'My error message', 'context' => array(), 'level' => Logger::ERROR, 'level_name' => Logger::getLevelName(Logger::ERROR), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), 'extra' => array());
     $this->handle($errorRecord)->shouldReturn(true);
 }
Пример #2
0
 /**
  * @param array|string $messages
  * @param bool|false $newline
  * @param int $type
  */
 public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
 {
     $this->output->write($this->encode((array) $messages), $newline, $type);
 }
Пример #3
0
 /**
  * @param PassResult $result
  */
 public function handlePass(PassResult $result)
 {
     $this->output->write(sprintf('<pass>%s</pass>', $this->formatter->formatPass($result)));
 }