public function testCreate()
 {
     $actionAssembler = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Model\\Action\\ActionAssembler')->disableOriginalConstructor()->getMock();
     $processDefinition = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition')->disableOriginalConstructor()->getMock();
     $processFactory = new ProcessFactory($actionAssembler);
     $this->assertInstanceOf('Oro\\Bundle\\WorkflowBundle\\Model\\Process', $processFactory->create($processDefinition));
 }
 public function testCreate()
 {
     /** @var \PHPUnit_Framework_MockObject_MockObject|ActionAssembler $actionAssembler */
     $actionAssembler = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Model\\Action\\ActionAssembler')->disableOriginalConstructor()->getMock();
     /** @var \PHPUnit_Framework_MockObject_MockObject|ProcessDefinition $processDefinition */
     $processDefinition = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition')->disableOriginalConstructor()->getMock();
     /** @var \PHPUnit_Framework_MockObject_MockObject|ExpressionFactory $conditionFactory */
     $conditionFactory = $this->getMockBuilder('Oro\\Component\\ConfigExpression\\ExpressionFactory')->disableOriginalConstructor()->getMock();
     $processFactory = new ProcessFactory($actionAssembler, $conditionFactory);
     $this->assertInstanceOf('Oro\\Bundle\\WorkflowBundle\\Model\\Process', $processFactory->create($processDefinition));
 }
Beispiel #3
0
 /**
  * @param ProcessTrigger $processTrigger
  * @return Process
  */
 protected function getProcess(ProcessTrigger $processTrigger)
 {
     if (!array_key_exists($processTrigger->getId(), $this->processes)) {
         $this->processes[$processTrigger->getId()] = $this->factory->create($processTrigger->getDefinition());
     }
     return $this->processes[$processTrigger->getId()];
 }