Example #1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Mass transit exception message
  */
 public function testMassTransitException()
 {
     $entityManager = $this->createEntityManager();
     $entityManager->expects($this->once())->method('beginTransaction');
     $entityManager->expects($this->once())->method('rollback');
     $entityManager->expects($this->never())->method('commit');
     $this->registry->expects($this->once())->method('getManager')->will($this->returnValue($entityManager));
     $workflow = $this->createWorkflow();
     $workflowItem = $this->createWorkflowItem();
     $transition = 'test_transition';
     $workflow->expects($this->once())->method('transit')->with($workflowItem, $transition)->willThrowException(new \Exception('Mass transit exception message'));
     $this->workflowRegistry->expects($this->once())->method('getWorkflow')->willReturn($workflow);
     $this->workflowManager->massTransit([['workflowItem' => $workflowItem, 'transition' => $transition]]);
 }