コード例 #1
0
 public function testSearchLeaveEntitlementsSorting()
 {
     $parameterHolder = new LeaveEntitlementSearchParameterHolder();
     $entitlementList = TestDataService::loadObjectList('LeaveEntitlement', $this->fixture, 'LeaveEntitlement');
     // sort by leave type name
     $parameterHolder->setOrderBy('Desc');
     $parameterHolder->setOrderField('leave_type');
     $expected = array($entitlementList[1], $entitlementList[2], $entitlementList[3], $entitlementList[0], $entitlementList[5]);
     $results = $this->dao->searchLeaveEntitlements($parameterHolder);
     $this->_compareEntitlements($expected, $results);
     // sort by employee name
     $parameterHolder->setOrderBy('Asc');
     $parameterHolder->setOrderField('employee_name');
     $expected = array($entitlementList[1], $entitlementList[5], $entitlementList[0], $entitlementList[2], $entitlementList[3]);
     $results = $this->dao->searchLeaveEntitlements($parameterHolder);
     $this->_compareEntitlements($expected, $results);
 }