Example #1
0
 public function testResetWorkflowData()
 {
     $name = 'testWorkflow';
     $entityClass = 'Test:Entity';
     $workflowDefinition = new WorkflowDefinition();
     $workflowDefinition->setName($name)->setRelatedEntity($entityClass);
     $workflowItemsRepository = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\Repository\\WorkflowItemRepository')->disableOriginalConstructor()->setMethods(array('resetWorkflowData'))->getMock();
     $workflowItemsRepository->expects($this->once())->method('resetWorkflowData')->with($entityClass, array($name));
     $this->registry->expects($this->once())->method('getRepository')->with('OroWorkflowBundle:WorkflowItem')->will($this->returnValue($workflowItemsRepository));
     $this->workflowManager->resetWorkflowData($workflowDefinition);
 }