protected function createStepWithSkipCallable($number, $returnValue) { return Step::createFromConfig($number, array('skip' => function ($estimatedCurrentStepNumber, FormFlowInterface $flow) use($returnValue) { return $returnValue; })); }
public function testCreateFromConfig_bcOptionType() { $step = Step::createFromConfig(1, array('type' => 'myFormType')); $this->assertEquals(array('Step config option "type" is deprecated since version 3.0. Use "form_type" instead.'), $this->getDeprecationNotices()); $this->assertEquals('myFormType', $step->getFormType()); }
/** * Creates all steps from the given configuration. * @param array $stepsConfig * @return StepInterface[] Value with index 0 is step 1. */ public function createStepsFromConfig(array $stepsConfig) { $steps = array(); // fix array indexes not starting at 0 $stepsConfig = array_values($stepsConfig); foreach ($stepsConfig as $index => $stepConfig) { $steps[] = Step::createFromConfig($index + 1, $stepConfig); } return $steps; }
/** * @dataProvider dataSetGetType_invalidArguments * @expectedException \Craue\FormFlowBundle\Exception\InvalidTypeException */ public function testSetGetType_invalidArguments($type) { $step = new Step(); $step->setType($type); }