Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function generate(SuiteDocument $result, array $config)
 {
     $reportDoms = $this->reportManager->generateReports($result, $config['reports']);
     $compositeDom = new Document();
     $compositeEl = $compositeDom->createRoot('reports');
     foreach ($reportDoms as $reportsDom) {
         foreach ($reportsDom->xpath()->query('./report') as $reportDom) {
             $reportEl = $compositeDom->importNode($reportDom, true);
             $compositeEl->appendChild($reportEl);
         }
     }
     return $compositeDom;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function generate(SuiteCollection $collection, Config $config)
 {
     $reportDoms = $this->reportManager->generateReports($collection, $config['reports']);
     $compositeDom = new Document();
     $compositeEl = $compositeDom->createRoot('reports');
     $compositeEl->setAttribute('name', $config->getName());
     foreach ($reportDoms as $reportsDom) {
         foreach ($reportsDom->xpath()->query('./report') as $reportDom) {
             $reportEl = $compositeDom->importNode($reportDom, true);
             $compositeEl->appendChild($reportEl);
         }
     }
     return $compositeDom;
 }
Exemplo n.º 3
0
 /**
  * Return a SuiteCollection from a number of PHPBench xml files.
  *
  * @param string[] $files
  *
  * @return SuiteCollection
  */
 public function decodeFiles(array $files)
 {
     // combine into one document.
     //
     $suiteDocument = new Document('phpbench');
     $rootEl = $suiteDocument->createRoot('phpbench');
     foreach ($files as $file) {
         $fileDom = new Document();
         $fileDom->load($file);
         foreach ($fileDom->query('./suite') as $suiteEl) {
             $importedEl = $suiteDocument->importNode($suiteEl, true);
             $rootEl->appendChild($importedEl);
         }
     }
     return $this->decode($suiteDocument);
 }