/** * Execute display action of given step. * * @param Request $request * @param string $scenarioAlias * @param string $stepName * * @throws NotFoundHttpException * * @return Response */ public function displayAction(Request $request, $scenarioAlias, $stepName) { $this->processContext->setRequest($request); try { return $this->processCoordinator->display($scenarioAlias, $stepName, $request->query); } catch (InvalidArgumentException $e) { throw new NotFoundHttpException('The step you are looking for is not found.', $e); } }
/** * @test * @expectedException Sylius\Bundle\FlowBundle\Process\Coordinator\InvalidArgumentException * @expectedExceptionMessage Process scenario with alias "scenarioOne" is not registered */ public function shouldNotShowDisplayActionWhenScenarioIsNotRegistered() { $this->coordinator->display('scenarioOne', 'someStepName'); }