| @@ 61-81 (lines=21) @@ | ||
| 58 | $this->assertEquals($expected, $transitions->toArray()); |
|
| 59 | } |
|
| 60 | ||
| 61 | protected function getTransitionMock($name, $isStart = false, $step = null) |
|
| 62 | { |
|
| 63 | $transition = $this->getMockBuilder('Oro\Bundle\WorkflowBundle\Model\Transition') |
|
| 64 | ->disableOriginalConstructor() |
|
| 65 | ->getMock(); |
|
| 66 | $transition->expects($this->any()) |
|
| 67 | ->method('getName') |
|
| 68 | ->will($this->returnValue($name)); |
|
| 69 | if ($isStart) { |
|
| 70 | $transition->expects($this->any()) |
|
| 71 | ->method('isStart') |
|
| 72 | ->will($this->returnValue($isStart)); |
|
| 73 | } |
|
| 74 | if ($step) { |
|
| 75 | $transition->expects($this->any()) |
|
| 76 | ->method('getStepTo') |
|
| 77 | ->will($this->returnValue($step)); |
|
| 78 | } |
|
| 79 | ||
| 80 | return $transition; |
|
| 81 | } |
|
| 82 | ||
| 83 | public function testGetStartTransitions() |
|
| 84 | { |
|
| @@ 493-513 (lines=21) @@ | ||
| 490 | return $step; |
|
| 491 | } |
|
| 492 | ||
| 493 | protected function getTransitionMock($name, $isStart = false, $step = null) |
|
| 494 | { |
|
| 495 | $transition = $this->getMockBuilder('Oro\Bundle\WorkflowBundle\Model\Transition') |
|
| 496 | ->disableOriginalConstructor() |
|
| 497 | ->getMock(); |
|
| 498 | $transition->expects($this->any()) |
|
| 499 | ->method('getName') |
|
| 500 | ->will($this->returnValue($name)); |
|
| 501 | if ($isStart) { |
|
| 502 | $transition->expects($this->any()) |
|
| 503 | ->method('isStart') |
|
| 504 | ->will($this->returnValue($isStart)); |
|
| 505 | } |
|
| 506 | if ($step) { |
|
| 507 | $transition->expects($this->any()) |
|
| 508 | ->method('getStepTo') |
|
| 509 | ->will($this->returnValue($step)); |
|
| 510 | } |
|
| 511 | ||
| 512 | return $transition; |
|
| 513 | } |
|
| 514 | ||
| 515 | public function testGetAllowedTransitions() |
|
| 516 | { |
|