renderReport() public method

This method will be called when the engine has finished the source analysis phase.
public renderReport ( PHPMD\Report $report ) : void
$report PHPMD\Report
return void
Example #1
0
 /**
  * testRendererAddsProcessingErrorsToXmlReport
  *
  * @return void
  * @since 1.2.1
  */
 public function testRendererAddsProcessingErrorsToXmlReport()
 {
     // Create a writer instance.
     $writer = new WriterStub();
     $processingErrors = array(new ProcessingError('Failed for file "/tmp/foo.php".'), new ProcessingError('Failed for file "/tmp/bar.php".'), new ProcessingError('Failed for file "/tmp/baz.php".'));
     $report = $this->getReportMock(0);
     $report->expects($this->once())->method('getRuleViolations')->will($this->returnValue(new \ArrayIterator(array())));
     $report->expects($this->once())->method('getErrors')->will($this->returnValue(new \ArrayIterator($processingErrors)));
     $renderer = new XMLRenderer();
     $renderer->setWriter($writer);
     $renderer->start();
     $renderer->renderReport($report);
     $renderer->end();
     $this->assertXmlEquals($writer->getData(), 'renderer/xml_renderer_processing_errors.xml');
 }