addCoverageFromFile() public method

Adds the coverage contained in $coverageFile and deletes the file afterwards
public addCoverageFromFile ( string $coverageFile )
$coverageFile string Code coverage file
Example #1
0
 public function testCoverageFileDoesNotExist()
 {
     $coverageMerger = new CoverageMerger();
     $coverageMerger->addCoverageFromFile('no-such-file.cov');
     static::assertAttributeSame(null, 'coverage', $coverageMerger, 'No code coverage object was created');
 }
 /**
  * @dataProvider getReporterProvider
  *
  * @param string[] $coverageFiles
  */
 public function testGenerateHtml(array $coverageFiles)
 {
     $filename1 = $this->copyCoverageFile($coverageFiles[0], $this->targetDir);
     $filename2 = $this->copyCoverageFile($coverageFiles[1], $this->targetDir);
     $coverageMerger = new CoverageMerger();
     $coverageMerger->addCoverageFromFile($filename1);
     $coverageMerger->addCoverageFromFile($filename2);
     $target = $this->targetDir . '/coverage';
     static::assertFileNotExists($target);
     $coverageMerger->getReporter()->html($target);
     static::assertFileExists($target);
     static::assertFileExists($target . '/index.html', 'Index html file was not generated');
 }