コード例 #1
0
 /**
  * The root should be discrete paths
  *
  * If a directory or file starts with the same letters, don't
  * consider the commonality among them as the root
  * 
  * @return void
  */
 public function testFindCommonRootReturnsOnlyPaths()
 {
     $list = array('foo/bar/baz/woof', 'foo/bar/baz/qoof', 'foo/bar/bax/quux');
     $commonRoot = CloverCoverageReport::findCommonRoot($list);
     $this->assertEquals('foo/bar/', $commonRoot);
 }
コード例 #2
0
ファイル: Coverage.php プロジェクト: sumpygump/qis-client
 /**
  * Check coverage
  * 
  * @param string $targetFile Target file
  * @return void
  */
 protected function _checkCoverage($targetFile = null)
 {
     $file = $this->_qis->getProjectQisRoot() . DIRECTORY_SEPARATOR . 'test-results' . DIRECTORY_SEPARATOR . 'coverage.xml';
     if (!file_exists($file)) {
         throw new CoverageException("Cannot find file '{$file}'. " . "Ensure test module is executed first.");
     }
     $this->_qis->log('Parsing clover coverage report...');
     $report = new CloverCoverageReport($file, $targetFile, $this->_root, $this->_ignorePaths);
     $totalCoverage = $report->getTotalCoverage();
     $this->_saveTotalCoverage($totalCoverage);
 }