/** * @inheritDoc */ public function isSuccessful() { if ($this->symfonyProcess->isSuccessful()) { echo "[33m{$this->job->jobName()}: [36mHas finished without errors.\n"; } return $this->symfonyProcess->isSuccessful(); }
/** * @inheritdoc */ public function runProcess(Job $job, $processCommand) { $process = new Process($processCommand); $process->setTimeout(720); $process->start(function ($type, $buffer) use($job) { if (\Symfony\Component\Process\Process::ERR === $type) { echo "[33m{$job->jobName()}: [31mSTDERR > " . $buffer; } else { echo "[33m{$job->jobName()}: [32mSTDOUT > " . $buffer; } }); return new SymfonyProcess($job, $process); }
function let(Job $job, Cache $cache, Variable $variable, Stage $stage) { $job->jobName()->willReturn('phpspec_php_5_6'); $this->jobs = [$job]; $this->stages = [$stage]; $this->variables = [$variable]; $this->cache = $cache; $this->beConstructedWith($this->stages, $cache, $this->variables, $this->jobs); }