示例#1
0
 public function getCoverageFileName()
 {
     if ($this->currentlyExecuting !== null) {
         return $this->currentlyExecuting->getCoverageFileName();
     } else {
         return null;
     }
 }
示例#2
0
 /**
  * Prints the individual "quick" feedback for run
  * tests, that is the ".EF" items
  *
  * @param ExecutableTest $test
  */
 public function printFeedback(ExecutableTest $test)
 {
     $reader = new Reader($test->getTempFile());
     if (!$reader->hasResults()) {
         throw new \RuntimeException("Log file " . $test->getTempFile() . " is empty.\n                This means a PHPUnit process was unable to run " . $test->getPath() . "\n                Maybe there is more than one class in this file.");
     }
     $this->results->addReader($reader);
     $feedbackItems = $reader->getFeedback();
     $dataProviderOverhead = count($feedbackItems) - $test->getTestMethodCount();
     $this->totalCases += $dataProviderOverhead;
     foreach ($feedbackItems as $item) {
         $this->printFeedbackItem($item);
     }
     $warnings = $test->getWarnings();
     if ($warnings) {
         $this->addWarnings($warnings);
         foreach ($warnings as $warning) {
             $this->printFeedbackItem('W');
         }
     }
 }
示例#3
0
 /**
  * Prints the individual "quick" feedback for run
  * tests, that is the ".EF" items
  *
  * @param ExecutableTest $test
  */
 public function printFeedback(ExecutableTest $test)
 {
     $reader = new Reader($test->getTempFile());
     $this->results->addReader($reader);
     $feedbackItems = $reader->getFeedback();
     foreach ($feedbackItems as $item) {
         $this->printFeedbackItem($item);
     }
 }
示例#4
0
 /**
  * @param ExecutableTest $test
  */
 private function addCoverage($test)
 {
     $coverageFile = $test->getCoverageFileName();
     if (!file_exists($coverageFile)) {
         return;
     }
     if (filesize($coverageFile) == 0) {
         throw new \RuntimeException("Coverage file {$coverageFile} is empty. This means a PHPUnit process has crashed.");
     }
     $this->getCoverage()->addCoverage($this->getCoverageObject($coverageFile));
     unlink($coverageFile);
 }
示例#5
0
 /**
  * Prints test warnings.
  *
  * @param  ExecutableTest $test
  */
 protected function printTestWarnings($test)
 {
     $warnings = $test->getWarnings();
     if ($warnings) {
         $this->addWarnings($warnings);
         foreach ($warnings as $warning) {
             $this->printFeedbackItem('W');
         }
     }
 }
示例#6
0
 /**
  * @param ExecutableTest $test
  */
 private function addCoverage(ExecutableTest $test)
 {
     $coverageFile = $test->getCoverageFileName();
     $this->getCoverage()->addCoverageFromFile($coverageFile);
 }