ParaTest\Runners\PHPUnit\ResultPrinter::printFeedback PHP Method

printFeedback() public method

Prints the individual "quick" feedback for run tests, that is the ".EF" items
public printFeedback ( ParaTest\Runners\PHPUnit\ExecutableTest $test )
$test ParaTest\Runners\PHPUnit\ExecutableTest
    public function printFeedback(ExecutableTest $test)
    {
        try {
            $reader = new Reader($test->getTempFile());
        } catch (\InvalidArgumentException $e) {
            throw new \RuntimeException(sprintf("%s\n" . "The process: %s\n" . "This means a PHPUnit process was unable to run \"%s\"\n", $e->getMessage(), $test->getLastCommand(), $test->getPath()));
        }
        if (!$reader->hasResults()) {
            throw new \RuntimeException(sprintf("The process: %s\nLog file \"%s\" is empty.\n" . "This means a PHPUnit process was unable to run \"%s\"\n" . "Maybe there is more than one class in this file.", $test->getLastCommand(), $test->getTempFile(), $test->getPath()));
        }
        $this->results->addReader($reader);
        $this->processReaderFeedback($reader, $test->getTestCount());
        $this->printTestWarnings($test);
    }

Usage Example

Beispiel #1
0
 /**
  * Returns whether or not a test has finished being
  * executed. If it has, this method also halts a test process - optionally
  * throwing an exception if a fatal error has occurred -
  * prints feedback, and updates the overall exit code
  *
  * @param ExecutableTest $test
  * @return bool
  * @throws \Exception
  */
 private function testIsStillRunning($test)
 {
     if (!$test->isDoneRunning()) {
         return true;
     }
     $this->setExitCode($test);
     $test->stop();
     if ($this->options->stopOnFailure && $test->getExitCode() > 0) {
         $this->pending = array();
     }
     if (static::PHPUNIT_FATAL_ERROR === $test->getExitCode()) {
         throw new \Exception($test->getStderr());
     }
     $this->printer->printFeedback($test);
     if ($this->hasCoverage()) {
         $this->addCoverage($test);
     }
     return false;
 }