/** * @expectedException \Oro\Bundle\WorkflowBundle\Exception\ActionException * @expectedExceptionMessage Cannot transit workflow, instance of "stdClass" doesn't have workflow item. */ public function testExecuteFailsWhenThereIsNoWorkflowItem() { $expectedEntity = new \stdClass(); $context = new ItemStub(); $context->test = $expectedEntity; $options = ['entity' => new PropertyPath('test'), 'transition' => 'test_transition']; $this->workflowManager->expects($this->once())->method('getWorkflowItemByEntity')->with($expectedEntity)->will($this->returnValue(null)); $this->workflowManager->expects($this->never())->method('transit'); $this->action->initialize($options); $this->action->execute($context); }