/** * @return void * @throws \RuntimeException */ public function run() { try { $result = $this->task->execute(); } catch (\RuntimeException $e) { throw $e; } $result->setFork($this->fork); try { $this->resultQueue->enqueue($result); } catch (\RuntimeException $e) { throw $e; } }
/** * @test */ public function execute() { $task = new Task(function ($arg) { return 'foo' . $arg; }, 'bar', null); $this->assertInstanceOf('\\Ackintosh\\Snidel\\Result\\Result', $task->execute()); }