/** * @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; }
public function testCreateWizardShouldConfigureLayoutTemplate() { $wizardFactory = new WizardFactory($this->config); $stepFactoryStub = $this->getStepFactory(); $wizardFactory->setStepFactory($stepFactoryStub); $wizardStub = $this->getWizard(); $viewModelMock = $wizardStub->getViewModel(); $viewModelMock->expects($this->once())->method('setTemplate')->with($this->anything()); $serviceManagerStub = $this->getMock('Zend\\ServiceManager\\ServiceManager'); $serviceManagerStub->method('get')->with('Wizard\\Wizard')->will($this->returnValue($wizardStub)); $wizardFactory->setServiceManager($serviceManagerStub); $wizardFactory->create('Wizard\\Foo'); }