/** * @expectedException \Tonic\ParallelProcessRunner\Exception\ProcessesMustBeInReadyStatusException */ public function testAddNotReadyProcess() { $process = $this->getProcess(-1); try { $collection = new WaitProcessCollection(); $collection->add($process); } catch (ProcessesMustBeInReadyStatusException $exception) { $this->assertEquals($process, $exception->getProcess()); throw $exception; } }
/** * @param Process|Process[]|ProcessCollection|array $processes * * @throws AbstractProcessException * * @return $this */ public function add($processes) { $this->waitCollection->add($processes); return $this; }