/** * @param array $values */ protected function processCurrentStep(array $values) { $currentStep = $this->wizard->getCurrentStep(); $wizardEventManager = $this->wizard->getEventManager(); $wizardEventManager->trigger(WizardEvent::EVENT_PRE_PROCESS_STEP, $currentStep, ['values' => $values]); $complete = $currentStep->process($values); if (null !== $complete) { $currentStep->setComplete($complete); } $currentStep->setData($values); $wizardEventManager->trigger(WizardEvent::EVENT_POST_PROCESS_STEP, $currentStep); }
public function testGetCurrentStep() { $wizard = new Wizard(); $wizard->setIdentifierAccessor($this->getIdentifierAccessor()); $this->assertNull($wizard->getCurrentStep()); $steps = $wizard->getSteps(); for ($i = 1; $i <= 3; $i++) { $step = $this->getStep('step' . $i); $steps->add($step); } $this->assertInstanceOf('Wizard\\Step\\StepInterface', $wizard->getCurrentStep()); }