/** * @dataProvider isAllowedDataProvider * @param bool $isAllowed * @param bool $expected */ public function testIsAllowed($isAllowed, $expected) { $workflowItem = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowItem')->disableOriginalConstructor()->getMock(); $obj = new Transition(); if (null !== $isAllowed) { $condition = $this->getMock('Oro\\Bundle\\WorkflowBundle\\Model\\Condition\\ConditionInterface'); $condition->expects($this->once())->method('isAllowed')->with($workflowItem)->will($this->returnValue($isAllowed)); $obj->setCondition($condition); } $this->assertEquals($expected, $obj->isAllowed($workflowItem)); }