/** * Display list of job applications to HR admin or manager */ private function _viewApplicationList() { if ($this->authorizeObj->isAdmin() || $this->authorizeObj->isManager() || $this->authorizeObj->isDirector() || $this->authorizeObj->isAcceptor() || $this->authorizeObj->isOfferer()) { $managerId = $this->authorizeObj->isAdmin() ? null : $this->authorizeObj->getEmployeeId(); $applications = JobApplication::getList($managerId); $path = '/templates/recruitment/applicationList.php'; $objs['applications'] = $applications; $template = new TemplateMerger($objs, $path); $template->display(); } else { $this->_notAuthorized(); } }
/** * Test for function getList() */ public function testGetList() { // get list $list = JobApplication::getList(); $this->_compareApplications($this->jobApplications, $list); // get list for hiring manager with 2 related applications $list = JobApplication::getList(11); $expected = array(1 => $this->jobApplications[1], 2 => $this->jobApplications[2]); $this->_compareApplications($expected, $list); // get list for hiring manager with 1 related applications $list = JobApplication::getList(12); $expected = array(3 => $this->jobApplications[3]); $this->_compareApplications($expected, $list); // get list for hiring manager without any related applications $list = JobApplication::getList(15); $expected = array(); $this->_compareApplications($expected, $list); // Get list for manager scheduled to interview applicant $list = JobApplication::getList(13); $expected = array(1 => $this->jobApplications[1]); $this->_compareApplications($expected, $list); // Get list for manager scheduled to interview applicant $list = JobApplication::getList(14); $expected = array(1 => $this->jobApplications[1], 2 => $this->jobApplications[2]); $this->_compareApplications($expected, $list); }