/**
  * @param string $recordLevel
  * @param string|int $handlerLevel
  * @dataProvider dataProviderHandleSuccess
  */
 public function testHandleSuccessWithoutBubble($recordLevel, $handlerLevel)
 {
     $message = 'Success message';
     $extra = ['mode' => 'application mode'];
     $record = ['message' => $message, 'level' => $recordLevel, 'extra' => $extra];
     $this->consoleHandler->setLevel($handlerLevel);
     ob_start();
     $this->consoleHandler->setBubble(false);
     $result = $this->consoleHandler->handle($record);
     $output = ob_get_contents();
     ob_end_clean();
     $this->assertTrue($result);
     $this->assertContains('Success message', $output);
 }
Esempio n. 2
0
 public function testHandleWarning()
 {
     $message = 'Warnin message';
     $extra = ['mode' => 'application mode'];
     $record = ['message' => $message, 'level' => 300, 'extra' => $extra];
     $this->consoleHandler->setLevel(100);
     ob_start();
     $this->consoleHandler->setBubble(false);
     $result = $this->consoleHandler->handle($record);
     $output = ob_get_contents();
     ob_end_clean();
     $this->assertTrue($result);
     $this->assertContains($message, $output);
 }