コード例 #1
0
 public function testCurrentStepName()
 {
     $this->assertNull($this->workflowItem->getCurrentStep());
     $value = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowStep')->disableOriginalConstructor()->getMock();
     $this->workflowItem->setCurrentStep($value);
     $this->assertEquals($value, $this->workflowItem->getCurrentStep());
 }
コード例 #2
0
ファイル: WorkflowTest.php プロジェクト: Maksold/platform
 /**
  * @expectedException \Oro\Bundle\WorkflowBundle\Exception\UnknownStepException
  * @expectedExceptionMessage Step "unknown_step" not found
  */
 public function testGetAllowedTransitionsUnknownStepException()
 {
     $workflowStep = new WorkflowStep();
     $workflowStep->setName('unknown_step');
     $workflowItem = new WorkflowItem();
     $workflowItem->setCurrentStep($workflowStep);
     $workflow = $this->createWorkflow();
     $workflow->getTransitionsByWorkflowItem($workflowItem);
 }
コード例 #3
0
 /**
  * @param Workflow $workflow
  * @param WorkflowStep $currentStep
  * @return WorkflowItem
  */
 protected function createWorkflowItem(Workflow $workflow, $currentStep = null)
 {
     $result = new WorkflowItem();
     $result->setCurrentStep($currentStep);
     $result->setWorkflowName($workflow->getName());
     return $result;
 }