public function testFlowException() { $queue = new LocalArrayTestQueue(); $messageTransformer = new TaskMessageSerializeTransformer(); $taskFactory = new TaskFactorySimple(); $taskRunnerSupervisor = new TaskRunnerNullSupervisor(); $taskScheduler = new TaskScheduler($queue, $messageTransformer, $messageTransformer); $taskRunner = new TaskRunner($queue, $messageTransformer, $taskFactory, $messageTransformer, $taskRunnerSupervisor); $input = []; $taskInput = new TaskInput($input); $futureTaskResult = $taskScheduler->submit('testType', TestTask::class, $taskInput); $taskRunner->runOnce('testType'); $this->setExpectedException(\Exception::class); $futureTaskResult->getTaskResult()->getResult(); }
/** * @param string $type */ public function work($type) { $this->taskRunner->run($type); }