Esempio n. 1
0
 /**
  * Shows a list of active job vacancies to job applicant.
  */
 public function showVacanciesToApplicant()
 {
     $path = '/templates/recruitment/applicant/viewVacancies.php';
     $objs['vacancies'] = JobVacancy::getActive();
     $template = new TemplateMerger($objs, $path);
     $template->display();
 }
 /**
  * test the getActive function
  */
 public function testGetActive()
 {
     // Get all active
     $list = JobVacancy::getActive();
     $this->assertTrue(is_array($list));
     $this->assertEquals(2, count($list));
     $expected = array(1 => $this->jobVacancies[1], 4 => $this->jobVacancies[4]);
     $this->_compareVacancys($expected, $list);
     // Mark all as inactive and get all
     $sql = 'UPDATE hs_hr_job_vacancy SET active = ' . JobVacancy::STATUS_INACTIVE;
     $this->_runQuery($sql);
     $list = JobVacancy::getActive();
     $this->assertTrue(is_array($list));
     $this->assertEquals(0, count($list));
     // when no job vacancies available
     $this->_runQuery('DELETE from hs_hr_job_vacancy');
     $list = JobVacancy::getActive();
     $this->assertTrue(is_array($list));
     $this->assertEquals(0, count($list));
 }