/**
  * Test count method
  */
 public function testCount()
 {
     // Count all
     $count = JobSpec::getCount();
     $this->assertEquals(4, $count);
     // Match of ID
     $count = JobSpec::getCount(2, 0);
     $this->assertEquals(1, $count);
     // ID - no match
     $count = JobSpec::getCount(21, 0);
     $this->assertEquals(0, $count);
     // no match
     $count = JobSpec::getCount('XYZ', 1);
     $this->assertEquals(0, $count);
     // Partial match of name
     $count = JobSpec::getCount('Job', 1);
     $this->assertEquals(4, $count);
     // partial match of desc
     $count = JobSpec::getCount('xa', 2);
     $this->assertEquals(1, $count);
     // Full match of name
     $count = JobSpec::getCount('Job Spec 2', 1);
     $this->assertEquals(1, $count);
 }
 function countList($index, $schStr = '', $mode = -1, $esp = false)
 {
     $this->indexCode = $index;
     switch ($this->indexCode) {
         case 'EST':
             $this->empstat = new EmploymentStatus();
             $message = $this->empstat->countEmpStat($schStr, $mode);
             return $message;
         case 'JOB':
             $this->jobtit = new JobTitle();
             $message = $this->jobtit->countJobTitles($schStr, $mode);
             return $message;
         case 'SPC':
             return JobSpec::getCount($schStr, $mode);
         case 'LOC':
             $this->location = new models_eimadmin_Location();
             $message = $this->location->countLocations($schStr, $mode);
             return $message;
         case 'COS':
             $this->costcenter = new CostCenter();
             $message = $this->costcenter->countCostCenters($schStr, $mode);
             return $message;
         case 'CUR':
             $this->currencytype = new CurrencyTypes();
             $message = $this->currencytype->countCurrencyTypes($schStr, $mode);
             return $message;
         case 'CHI':
             $this->comphier = new CompHierachy();
             $message = $this->comphier->countCompHierachy($schStr, $mode);
             return $message;
         case 'CTT':
             $this->corptit = new CorpTitle();
             $message = $this->corptit->countCorpTitles($schStr, $mode);
             return $message;
         case 'JDC':
             $this->jdcategory = new JDCategory();
             $message = $this->jdcategory->countJDCategorys($schStr, $mode);
             return $message;
         case 'JDT':
             $this->jdtype = new JDType();
             $message = $this->jdtype->countJDTypes($schStr, $mode);
             return $message;
         case 'QLF':
             $this->qualtype = new QualificationType();
             $message = $this->qualtype->countQualificationTypes($schStr, $mode);
             return $message;
         case 'RTM':
             $this->ratingmethods = new RatingTypes();
             $message = $this->ratingmethods->countRatingTypes($schStr, $mode);
             return $message;
         case 'SKI':
             $this->skills = new Skills();
             $message = $this->skills->countSkills($schStr, $mode);
             return $message;
         case 'ETH':
             $this->ethnicrace = new EthnicRace();
             $message = $this->ethnicrace->countEthnicRace($schStr, $mode);
             return $message;
         case 'EXC':
             $this->extracurract = new ExtraCurrActCat();
             $message = $this->extracurract->countExtraCurrActCat($schStr, $mode);
             return $message;
         case 'MEM':
             $this->membershiptype = new MembershipType();
             $message = $this->membershiptype->countMembershipType($schStr, $mode);
             return $message;
         case 'UNI':
             $this->uniformtypes = new UniformType();
             $message = $this->uniformtypes->countUniformType($schStr, $mode);
             return $message;
         case 'SAT':
             $this->satutoryinfo = new SatutoryInfo();
             $message = $this->satutoryinfo->countSatutoryInfo($schStr, $mode);
             return $message;
         case 'EMC':
             $this->employeecat = new EmployeeCat();
             $message = $this->employeecat->countEmployeeCat($schStr, $mode);
             return $message;
         case 'EMG':
             $this->employeegroup = new EmployeeGroup();
             $message = $this->employeegroup->countEmployeeGroup($schStr, $mode);
             return $message;
         case 'RTE':
             $this->routeinformation = new RouteInfo();
             $message = $this->routeinformation->countRouteInfo($schStr, $mode);
             return $message;
         case 'DWT':
             $this->routeinformation = new DwellingType();
             $message = $this->routeinformation->countDwellingType($schStr, $mode);
             return $message;
         case 'NAT':
             $this->nationalityinfo = new NationalityInfo();
             $message = $this->nationalityinfo->countNationalityInfo($schStr, $mode);
             return $message;
         case 'RLG':
             $this->religioninfo = new ReligionInfo();
             $message = $this->religioninfo->countReligionInfo($schStr, $mode);
             return $message;
         case 'COU':
             $this->countryinfo = new CountryInfo();
             $message = $this->countryinfo->countCountryInfo($schStr, $mode);
             return $message;
         case 'DEF':
             $this->hierachinfo = new HierarchyDefInfo();
             $message = $this->hierachinfo->countHierarchyDefInfo($schStr, $mode);
             return $message;
         case 'TAX':
             $this->taxinfo = new TaxInfo();
             $message = $this->taxinfo->countTaxInfo($schStr, $mode);
             return $message;
         case 'PRO':
             $this->provinceinfo = new ProvinceInfo();
             $message = $this->provinceinfo->countProvinceInfo($schStr, $mode);
             return $message;
         case 'DIS':
             $this->districtinfo = new DistrictInfo();
             $message = $this->districtinfo->countDistrictInfo($schStr, $mode);
             return $message;
         case 'ELE':
             $this->electorateinfo = new ElectorateInfo();
             $message = $this->electorateinfo->countElectorateInfo($schStr, $mode);
             return $message;
         case 'BNK':
             $this->bankinfo = new BankInfo();
             $message = $this->bankinfo->countBankInfo($schStr, $mode);
             return $message;
         case 'LAN':
             $this->languageinfo = new LanguageInfo();
             $message = $this->languageinfo->countLanguageInfo($schStr, $mode);
             return $message;
         case 'MME':
             $this->membershipinformation = new MembershipInfo();
             $message = $this->membershipinformation->countMembershipInfo($schStr, $mode);
             return $message;
         case 'SSK':
             $this->subskillinformation = new SubSkillInfo();
             $message = $this->subskillinformation->countSubSkillInfo($schStr, $mode);
             return $message;
         case 'EXA':
             $this->extracurractinfo = new ExtraCurActInfo();
             $message = $this->extracurractinfo->countExtraCurActInfo($schStr, $mode);
             return $message;
         case 'SGR':
             $this->salarygrade = new SalaryGrades();
             $message = $this->salarygrade->countSalaryGrades($schStr, $mode);
             return $message;
         case 'DSG':
             $this->designation = new Designations();
             $message = $this->designation->countDesignations($schStr, $mode);
             return $message;
         case 'DDI':
             $this->designation = new Designations();
             $message = $this->designation->countDesignations($schStr, $mode);
             return $message;
         case 'DQA':
             $this->designation = new Designations();
             $message = $this->designation->countDesignationsDes($schStr, $mode);
             return $message;
         case 'JDK':
             $this->jdkra = new JDKra();
             $message = $this->jdkra->countJDKra($schStr, $mode);
             return $message;
         case 'EDU':
             $this->edu = new Education();
             $message = $this->edu->countEducation($schStr, $mode);
             return $message;
         case 'BCH':
             $this->brch = new Branches();
             $message = $this->brch->countBranches($schStr, $mode);
             return $message;
         case 'CCB':
             $this->cashben = new CashBen();
             $message = $this->cashben->countCashBenefits($schStr, $mode);
             return $message;
         case 'NCB':
             $this->noncashben = new NonCashBen();
             $message = $this->noncashben->countNonCashBenefits($schStr, $mode);
             return $message;
         case 'BBS':
             $this->cashben = new CashBen();
             $message = $this->cashben->countCashBenefits($schStr, $mode);
             return $message;
         case 'NBS':
             $this->noncashben = new NonCashBen();
             $message = $this->noncashben->countNonCashBenefits($schStr, $mode);
             return $message;
         case 'ETY':
             $this->emptyp = new EmployeeType();
             $message = $this->emptyp->countEmployeeTypes($schStr, $mode);
             return $message;
         case 'SBJ':
             $this->subjectinfo = new SubjectInfo();
             $message = $this->subjectinfo->countSubjectInfo($schStr, $mode);
             return $message;
         case 'EEC':
             $this->eeojobcat = new EEOJobCat();
             $message = $this->eeojobcat->countEEOJobCat($schStr, $mode);
             return $message;
         case 'LIC':
             $this->licenses = new Licenses();
             $message = $this->licenses->countLicenses($schStr, $mode);
             return $message;
         case 'USG':
             $this->usergroups = new UserGroups();
             $message = $this->usergroups->countUserGroups($schStr, $mode);
             return $message;
         case 'CUS':
             $this->custormers = new Customer();
             $message = $this->custormers->countcustomerID($schStr, $mode);
             return $message;
         case 'CTM':
             $customerFields = new CustomFields();
             $list = $customerFields->getCustomFieldList();
             $message = count($list);
             return $message;
         case 'CEX':
             $list = CustomExport::getCustomExportList();
             return count($list);
         case 'CIM':
             $list = CustomImport::getCustomImportList();
             return count($list);
         case 'PRJ':
             $this->projects = new Projects();
             $message = $this->projects->countprojectID($schStr, $mode);
             return $message;
         case 'USR':
             $this->users = new Users();
             $message = $this->users->countUsers($schStr, $mode, $esp);
             return $message;
     }
 }