示例#1
0
 public function writeMergedResult($output_file)
 {
     if (empty($this->files)) {
         throw new \LogicException('Cannot write merge results, no files given');
     }
     $collector = new CloverXmlCoverageCollector();
     foreach ($this->files as $xmlfile) {
         $collector->collect(simplexml_load_file($xmlfile), '.');
     }
     $this->jsonFile = $collector->getJsonFile();
     $this->jsonFile->sortSourceFiles();
     return file_put_contents($output_file, $this->jsonFile);
 }
示例#2
0
文件: Jobs.php 项目: Ryu0621/SaNaVi
 public function collectCloverXml()
 {
     $rootDir = $this->config->getRootDir();
     $cloverXmlPaths = $this->config->getCloverXmlPaths();
     $xmlCollector = new CloverXmlCoverageCollector();
     foreach ($cloverXmlPaths as $cloverXmlPath) {
         $xml = simplexml_load_file($cloverXmlPath);
         $xmlCollector->collect($xml, $rootDir);
     }
     $this->jsonFile = $xmlCollector->getJsonFile();
     if ($this->config->isExcludeNoStatements()) {
         $this->jsonFile->excludeNoStatementsFiles();
     }
     $this->jsonFile->sortSourceFiles();
     return $this;
 }
示例#3
0
 protected function collectJsonFileWithoutSourceFiles()
 {
     $xml = $this->createNoSourceCloverXml();
     $collector = new CloverXmlCoverageCollector();
     return $collector->collect($xml, $this->srcDir);
 }