Exemplo n.º 1
0
 protected function createStepWithSkipCallable($number, $returnValue)
 {
     return Step::createFromConfig($number, array('skip' => function ($estimatedCurrentStepNumber, FormFlowInterface $flow) use($returnValue) {
         return $returnValue;
     }));
 }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 /**
  * 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;
 }
Exemplo n.º 4
0
 /**
  * @dataProvider dataSetGetType_invalidArguments
  * @expectedException \Craue\FormFlowBundle\Exception\InvalidTypeException
  */
 public function testSetGetType_invalidArguments($type)
 {
     $step = new Step();
     $step->setType($type);
 }