Ejemplo n.º 1
0
 public function testGetFormWhenCurrentStepIsTheFirstShouldRemovePreviousAndValidButton()
 {
     $wizard = new Wizard();
     $wizard->setIdentifierAccessor($this->getIdentifierAccessor());
     $formMock = $this->getMock('Zend\\Form\\Form');
     $formMock->expects($this->exactly(2))->method('remove')->with($this->logicalOr($this->equalTo('previous'), $this->equalTo('valid')));
     $formFactoryStub = $this->getMock('Wizard\\Form\\FormFactory');
     $formFactoryStub->method('create')->will($this->returnValue($formMock));
     $wizard->setFormFactory($formFactoryStub);
     $steps = $wizard->getSteps();
     $steps->add($this->getStep('foo'));
     $steps->add($this->getStep('bar'));
     $wizard->getForm();
 }