/** * @param ServiceLocatorInterface $serviceLocator * @return WizardFactory */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Wizard\\Config'); $wizardFactory = new WizardFactory($config); $stepFactory = $serviceLocator->get('Wizard\\Step\\StepFactory'); $wizardFactory->setStepFactory($stepFactory); return $wizardFactory; }
/** * @param MvcEvent $e */ public function process(MvcEvent $e) { $wizard = $this->resolver->resolve(); if (!$wizard) { return; } $instance = $this->factory->create($wizard); $instance->process(); }
/** * @expectedException \Wizard\Exception\RuntimeException */ public function testCreateInvalidWizard() { $wizardFactory = new WizardFactory([]); $wizardFactory->create('invalid'); }