Exemplo n.º 1
0
 /**
  * @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;
 }
Exemplo n.º 2
0
 /**
  * @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();
 }
Exemplo n.º 3
0
 /**
  * @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);
 }