/** * Test the sendInterviewTaskToManager function */ public function testSendInterviewTaskToManager() { $jobApplication = $this->jobApplications[1]; $jobApplication->setStatus(JobApplication::STATUS_FIRST_INTERVIEW_SCHEDULED); $jobApplication->save(); $jobAppEvent = JobApplicationEvent::getJobApplicationEvent(1); $notifier = new RecruitmentMailNotifier(); $mockMailer = new MockMailer(); $notifier->setMailer($mockMailer); $notifier->sendInterviewTaskToManager($jobAppEvent); $attachments = $mockMailer->getAttachments(); $this->assertEquals(3, count($attachments)); }
private function _approve($event) { if ($this->authorizeObj->isAdmin() || $this->authorizeObj->isDirector() || $this->authorizeObj->isAcceptor()) { // TODO: Validate if Hiring manager or interview manager and in correct status $application = JobApplication::getJobApplication($event->getApplicationId()); $application->setStatus(JobApplication::STATUS_HIRED); try { $application->save(); $this->_saveApplicationEvent($event, JobApplicationEvent::EVENT_APPROVE); // Create employee in PIM $empId = $this->createEmployeeFromApplication($application); // Save new employee number in application for reference. $application->setEmpNumber($empId); $application->save(); // Send email informing approval to hiring manager $notifier = new RecruitmentMailNotifier(); $mailResult = $notifier->sendApprovalToHiringManager($application, $event); $message = 'UPDATE_SUCCESS'; } catch (Exception $e) { $message = 'UPDATE_FAILURE'; } $this->redirect($message, '?recruitcode=Application&action=List'); //$this->_viewApplicationList(); } else { $this->_notAuthorized(); } }