/** * Test for getCustomImportListForView(). */ public function testGetCustomImportListForView() { $recordFound = CustomImport::getCustomImportListForView(1, "Import 2", 1); $this->assertTrue(is_array($recordFound)); $this->assertEquals(1, count($recordFound)); $this->assertEquals($recordFound[0][0], 2); $this->assertEquals($recordFound[0][1], "Import 2"); $this->assertEquals($recordFound[0][2], "empId,lastName,firstName,city"); $recordFound = CustomImport::getCustomImportListForView(1, "Import 3", 1); $this->assertTrue(is_array($recordFound)); $this->assertEquals(1, count($recordFound)); $this->assertEquals($recordFound[0][0], 3); $this->assertEquals($recordFound[0][1], "Import 3"); $this->assertEquals($recordFound[0][2], "empId,firstName,lastName,street1,street2,city"); $recordFound = CustomImport::getCustomImportListForView(1, "Import 1", 1); $this->assertTrue(is_array($recordFound)); $this->assertEquals(1, count($recordFound)); $this->assertEquals($recordFound[0][0], 1); $this->assertEquals($recordFound[0][1], "Import 1"); $this->assertEquals($recordFound[0][2], "empId,lastName,firstName,middleName,street1,street2,city"); $recordFound = CustomImport::getCustomImportListForView(1, "Import New", 1); $this->assertFalse(is_array($recordFound)); // clean up $this->_runQuery("DELETE FROM hs_hr_custom_import"); }
function selectIndexId($pageNO, $schStr, $mode, $sortField = 0, $sortOrder = 'ASC', $esp = false) { switch ($this->indexCode) { case 'EST': $this->empstat = new EmploymentStatus(); $message = $this->empstat->getListofEmpStat($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'JOB': $this->jobtit = new JobTitle(); $message = $this->jobtit->getListofJobTitles($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'SPC': return JobSpec::getListForView($pageNO, $schStr, $mode, $sortField, $sortOrder); case 'LOC': $this->location = new models_eimadmin_Location(); $message = $this->location->getListofLocations($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'SKI': $this->skills = new Skills(); $message = $this->skills->getListofSkills($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'ETH': $this->ethnicrace = new EthnicRace(); $message = $this->ethnicrace->getListofEthnicRace($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'MEM': $this->membershiptype = new MembershipType(); $message = $this->membershiptype->getListofMembershipType($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'NAT': $this->nationalityinfo = new NationalityInfo(); $message = $this->nationalityinfo->getListofNationalityInfo($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'LAN': $this->languageinfo = new LanguageInfo(); $message = $this->languageinfo->getListofLanguageInfo($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'MME': $this->membershipinformation = new MembershipInfo(); $message = $this->membershipinformation->getListofMembershipInfo($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'SGR': $this->salarygrade = new SalaryGrades(); $message = $this->salarygrade->getListofSalaryGrades($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'EDU': $this->qual = new Education(); $message = $this->qual->getListofEducation($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'BBS': $this->salgrd = new SalaryGrades(); $message = $this->salgrd->getListofCashBenefits($pageNO, $schStr, $mode); return $message; case 'NBS': $this->salgrd = new SalaryGrades(); $message = $this->salgrd->getListofNonCashBenefits($pageNO, $schStr, $mode); return $message; case 'EEC': $this->eeojobcat = new EEOJobCat(); $message = $this->eeojobcat->getListofEEOJobCat($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'LIC': $this->licenses = new Licenses(); $message = $this->licenses->getListofLicenses($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'USG': $this->userGroups = new UserGroups(); $message = $this->userGroups->getListOfUserGroups($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'CUS': $this->customer = new Customer(); $message = $this->customer->getListofCustomers($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'CTM': $this->customFields = new CustomFields(); $message = $this->customFields->getCustomerFieldListForView($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'CEX': return CustomExport::getCustomExportListForView($pageNO, $schStr, $mode, $sortField, $sortOrder); case 'CIM': return CustomImport::getCustomImportListForView($pageNO, $schStr, $mode, $sortField, $sortOrder); case 'PRJ': $this->projects = new Projects(); $message = $this->projects->getListOfProjectsStr($pageNO, $schStr, $mode, $sortField, $sortOrder); return $message; case 'USR': $this->user = new Users(); $message = $this->user->getListOfUsers($pageNO, $schStr, $mode, $sortField, $sortOrder, $esp); return $message; } }
/** * Test for getCustomImportListForView(). */ public function testGetCustomImportListForView() { $list = CustomImport::getCustomImportListForView(1, "", ""); $this->assertTrue(is_array($list)); $this->assertEquals(3, count($list)); $expected = array(1 => 'Import 1', 2 => 'Import 2', 3 => 'Import 3'); foreach ($list as $import) { $id = $import[0]; $name = $import[1]; $this->assertTrue(array_key_exists($id, $expected)); $this->assertEquals($expected[$id], $name); unset($expected[$id]); } $this->assertTrue(empty($expected)); $this->_runQuery("DELETE FROM hs_hr_custom_import"); $list = CustomImport::getCustomImportListForView(1, "", ""); $this->assertNull($list); }