public function testGetLeaveActions()
 {
     $loggedInEmpNumber = 4;
     $leave = new Leave();
     $leave->setStatus(Leave::LEAVE_STATUS_LEAVE_PENDING_APPROVAL);
     $leave->setEmpNumber(5);
     $approveAction = new WorkflowStateMachine();
     $approveAction->fromArray(array('id' => 2, 'workflow' => 'leave', 'state' => 'PENDING APPROVAL', 'role' => 'ADMIN', 'action' => 'APPROVE', 'resulting_state' => 'SCHEDULED', 'roles_to_notify' => '', 'priority' => 0));
     $cancelAction = new WorkflowStateMachine();
     $cancelAction->fromArray(array('id' => 3, 'workflow' => 'leave', 'state' => 'PENDING APPROVAL', 'role' => 'ADMIN', 'action' => 'CANCEL', 'resulting_state' => 'CANCELLED', 'roles_to_notify' => '', 'priority' => 0));
     $rejectAction = new WorkflowStateMachine();
     $rejectAction->fromArray(array('id' => 5, 'workflow' => 'leave', 'state' => 'PENDING APPROVAL', 'role' => 'ADMIN', 'action' => 'REJECT', 'resulting_state' => 'REJECTED', 'roles_to_notify' => '', 'priority' => 0));
     $actions = array($approveAction, $cancelAction, $rejectAction);
     $userManager = $this->getMock('BasicUserRoleManager', array('getAllowedActions'));
     $userManager->expects($this->any())->method('getAllowedActions')->with(WorkflowStateMachine::FLOW_LEAVE, $leave->getTextLeaveStatus(), array(), array())->will($this->returnValue($actions));
     $this->leaveRequestService->setUserRoleManager($userManager);
     $result = $this->leaveRequestService->getLeaveActions($leave, $loggedInEmpNumber);
     $this->verifyLeaveActions($actions, $result);
 }