/** * @param ServiceLocatorInterface $serviceLocator * @return Wizard */ public function createService(ServiceLocatorInterface $serviceLocator) { /* @var $wizard \Wizard\WizardInterface */ $wizard = new Wizard(); $formFactory = $serviceLocator->get('Wizard\\Form\\FormFactory'); $wizard->setFormFactory($formFactory); $wizardProcessor = $serviceLocator->get('Wizard\\WizardProcessor'); $wizard->setWizardProcessor($wizardProcessor); $identifierAccessor = $serviceLocator->get('Wizard\\Wizard\\IdentifierAccessor'); $wizard->setIdentifierAccessor($identifierAccessor); $wizardListener = $serviceLocator->get('Wizard\\Listener\\WizardListener'); $wizard->getEventManager()->attachAggregate($wizardListener); $stepCollection = $wizard->getSteps(); $stepCollectionListener = $serviceLocator->get('Wizard\\Listener\\StepCollectionListener'); $stepCollection->getEventManager()->attachAggregate($stepCollectionListener); return $wizard; }
/** * @return HttpResponse */ protected function doCancel() { $options = $this->wizard->getOptions(); $cancelUrl = $options->getCancelUrl(); return $this->redirect($cancelUrl); }
public function testSetAndGetStepCollection() { $wizard = new Wizard(); $this->assertInstanceOf('Wizard\\Step\\StepCollection', $wizard->getSteps()); }