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()); }
/** * @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); }
/** * @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; }