コード例 #1
0
ファイル: Step.php プロジェクト: jayesbe/CraueFormFlowBundle
 /**
  * {@inheritDoc}
  */
 public function getLabel()
 {
     try {
         return $this->label !== null ? $this->label->getText() : null;
     } catch (StepLabelCallableInvalidReturnValueException $e) {
         throw new \RuntimeException(sprintf('The label callable for step %d did not return a string or null value.', $this->number));
     }
 }
コード例 #2
0
 protected function createStepWithLabelCallable($number, $returnValue)
 {
     return Step::createFromConfig($number, array('label' => StepLabel::createCallableLabel(function () use($returnValue) {
         return $returnValue;
     })));
 }
コード例 #3
0
 /**
  * @dataProvider dataGetText_callableInvalidReturnValue
  * @expectedException Craue\FormFlowBundle\Exception\StepLabelCallableInvalidReturnValueException
  */
 public function testGetText_callableInvalidReturnValue($value)
 {
     StepLabel::createCallableLabel($value)->getText();
 }