Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @return HttpResponse
  */
 protected function doCancel()
 {
     $options = $this->wizard->getOptions();
     $cancelUrl = $options->getCancelUrl();
     return $this->redirect($cancelUrl);
 }
Ejemplo n.º 3
0
 public function testSetAndGetStepCollection()
 {
     $wizard = new Wizard();
     $this->assertInstanceOf('Wizard\\Step\\StepCollection', $wizard->getSteps());
 }