Exemplo n.º 1
0
 public function testAddException()
 {
     $entry = new Entry(self::FAKE_ID);
     $entry->addException('exception #1');
     $entry->addException('exception #2');
     $this->assertEquals(2, count($entry->getExceptions()));
 }
Exemplo n.º 2
0
 /**
  * Saves report to a file.
  *
  * @param Entry $entry
  * @throws ReportException
  */
 public function save(Entry $entry)
 {
     $content = sprintf("User: %s", $entry->getId());
     $messages = $this->createMessageReport($entry->getMessages());
     $exceptions = $this->createExceptionReport($entry->getExceptions());
     $content .= PHP_EOL . $messages . PHP_EOL . $exceptions;
     $this->saveToFile($content);
 }
Exemplo n.º 3
0
 public function createExceptionReport()
 {
     $report = new TextReport($this->path);
     $messages = $this->invokeMethod($report, 'createExceptionReport', [$this->entry->getExceptions()]);
     $this->assertNotNull($messages);
 }