/**
  * 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));
 }
예제 #2
0
 private function _saveSecondInterview($event)
 {
     if ($this->authorizeObj->isAdmin() || $this->authorizeObj->isManager() || $this->authorizeObj->isOfferer()) {
         // TODO: Validate if Hiring manager or interview manager and in correct status
         $applicationId = $event->getApplicationId();
         $application = JobApplication::getJobApplication($applicationId);
         $application->setStatus(JobApplication::STATUS_SECOND_INTERVIEW_SCHEDULED);
         try {
             $application->save();
             $event->setEventType(JobApplicationEvent::EVENT_SCHEDULE_SECOND_INTERVIEW);
             $event->setStatus(JobApplicationEvent::STATUS_INTERVIEW_SCHEDULED);
             $event->setCreatedBy($_SESSION['user']);
             $event->save();
             // Send notification to Interviewer
             $notifier = new RecruitmentMailNotifier();
             $notifier->sendInterviewTaskToManager($event);
             $message = 'UPDATE_SUCCESS';
         } catch (Exception $e) {
             $message = 'UPDATE_FAILURE';
         }
         $this->redirect($message, '?recruitcode=Application&action=List');
         //$this->_viewApplicationList();
     } else {
         $this->_notAuthorized();
     }
 }