/** * @test * @expectedException \Symfony\Component\HttpKernel\Exception\HttpException */ public function shouldNotStartWhenProcessIsNotValid() { $router = $this->getRouter(); $processBuilder = $this->getProcessBuilder($this->getProcess()); $processContext = $this->getProcessContext(); $processContext->expects($this->any())->method('isValid')->will($this->returnValue(false)); $this->coordinator = $this->createCoordinator($router, $processBuilder, $processContext); $this->coordinator->registerScenario('scenarioOne', $this->getMock('Sylius\\Bundle\\FlowBundle\\Process\\Scenario\\ProcessScenarioInterface')); $this->coordinator->start('scenarioOne'); }
/** * Build and start process for given scenario. * This action usually redirects to first step. * * @param Request $request * @param string $scenarioAlias * * @return Response */ public function startAction(Request $request, $scenarioAlias) { return $this->processCoordinator->start($scenarioAlias, $request->query); }