/** * @param ParaunitProcessInterface $process * @return array | \stdClass[] */ public function fetch(ParaunitProcessInterface $process) { $filePath = $this->fileName->getFilenameForLog($process->getUniqueId()); $fileContent = ''; if (file_exists($filePath)) { $fileContent = file_get_contents($filePath); unlink($filePath); } $logs = json_decode($this->cleanLog($fileContent)); $logs[] = $this->createLogEnding(); return $logs; }
/** * @param AbstractParaunitProcess $process * @return CodeCoverage */ public function fetch(AbstractParaunitProcess $process) { $tempFilename = $this->tempFilenameFactory->getFilenameForCoverage($process->getUniqueId()); $codeCoverage = null; if ($this->coverageFileIsValid($tempFilename)) { $codeCoverage = (require $tempFilename); unlink($tempFilename); } if ($codeCoverage instanceof CodeCoverage) { return $codeCoverage; } return new CodeCoverage(); }
/** * @param PHPUnitConfig $config * @param string $uniqueId * @return string */ public function getOptions(PHPUnitConfig $config, $uniqueId) { return '-c ' . $config->getFileFullPath() . ' --log-json ' . $this->filenameFactory->getFilenameForLog($uniqueId) . $this->createOptionsString($config); }