public function getCoverageFileName() { if ($this->currentlyExecuting !== null) { return $this->currentlyExecuting->getCoverageFileName(); } else { return null; } }
/** * 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'); } } }
/** * 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); } }
/** * @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); }
/** * 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'); } } }
/** * @param ExecutableTest $test */ private function addCoverage(ExecutableTest $test) { $coverageFile = $test->getCoverageFileName(); $this->getCoverage()->addCoverageFromFile($coverageFile); }