/**
  * Set up method
  */
 protected function setUp()
 {
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/BasicUserRoleManager.yml';
     TestDataService::truncateSpecificTables(array('SystemUser', 'Project', 'JobCandidate', 'JobVacancy', 'JobInterview'));
     TestDataService::populate($this->fixture);
     $this->manager = new BasicUserRoleManager();
 }
Esempio n. 2
0
 /**
  * Set up method
  */
 protected function setUp()
 {
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/test/fixtures/ScreenDao.yml';
     TestDataService::truncateSpecificTables(array('SystemUser'));
     TestDataService::populate($this->fixture);
     $this->dao = new ScreenDao();
 }
 protected function setUp()
 {
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmTimePlugin/test/fixtures/TimesheetService.yml';
     TestDataService::truncateSpecificTables(array('SystemUser'));
     TestDataService::populate($this->fixture);
     $this->timesheetService = new TimesheetService();
 }
 protected function setUp()
 {
     TestDataService::truncateSpecificTables(array('Employee', 'Leave', 'LeaveRequest', 'LeaveType', 'EmployeeLeaveEntitlement', 'LeavePeriod'));
     // Save leave type
     $leaveTypeData = sfYaml::load(sfConfig::get('sf_plugins_dir') . '/orangehrmCoreLeavePlugin/test/fixtures/leaveType.yml');
     $leaveTypeDao = new LeaveTypeDao();
     $leaveType = new LeaveType();
     $leaveType->setLeaveTypeName($leaveTypeData['leaveType']['LT_001']['name']);
     //                $leaveType->setLeaveRules($leaveTypeData['leaveType']['LT_001']['rule']);
     $leaveTypeDao->saveLeaveType($leaveType);
     $this->leaveType = $leaveType;
     $this->leaveTypeId = $leaveType->getLeaveTypeId();
     // Save leave Period
     $leavePeriodData = sfYaml::load(sfConfig::get('sf_plugins_dir') . '/orangehrmCoreLeavePlugin/test/fixtures/leavePeriod.yml');
     $leavePeriodService = new LeavePeriodService();
     $leavePeriodService->setLeavePeriodDao(new LeavePeriodDao());
     $leavePeriod = new LeavePeriod();
     $leavePeriod->setStartDate($leavePeriodData['leavePeriod']['1']['startDate']);
     $leavePeriod->setEndDate($leavePeriodData['leavePeriod']['1']['endDate']);
     $leavePeriodService->saveLeavePeriod($leavePeriod);
     $this->leavePeriod = $leavePeriod;
     $this->leavePeriodId = $leavePeriod->getLeavePeriodId();
     // Save Employee
     $employeeservice = new EmployeeService();
     $this->employee = new Employee();
     $employeeservice->saveEmployee($this->employee);
     $this->empNumber = $this->employee->getEmpNumber();
     // save leave quota
     $this->leaveEntitlement = sfYaml::load(sfConfig::get('sf_plugins_dir') . '/orangehrmCoreLeavePlugin/test/fixtures/leaveEntitlement.yml');
     $this->leaveEntitlementDao = new LeaveEntitlementDao();
 }
Esempio n. 5
0
 public function testSaveLeaveTypeWithoutOperationalCountry()
 {
     TestDataService::truncateSpecificTables(array('LeaveType'));
     $leaveType = $this->_getLeaveTypeObjectWithValues();
     $this->leaveTypeDao->saveLeaveType($leaveType);
     $savedLeaveType = TestDataService::fetchLastInsertedRecord('LeaveType', 'leave_type_id');
     $this->assertTrue(is_null($savedLeaveType->getOperationalCountryId()));
 }
Esempio n. 6
0
 public function testSaveCandidateHistory()
 {
     TestDataService::truncateSpecificTables(array('CandidateHistory'));
     $candidateHistory = new CandidateHistory();
     $candidateHistory->vacancyId = 2;
     $candidateHistory->candidateId = 1;
     $candidateHistory->action = 2;
     $candidateHistory->performedBy = null;
     $candidateHistory->performedDate = '2011-04-05';
     $candidateHistory->note = 'dvfsdfds';
     $result = $this->candidateDao->SaveCandidateHistory($candidateHistory);
     $this->assertTrue($result);
 }
Esempio n. 7
0
 /**
  * Testing getVacancyList
  */
 public function testSaveJobVacancy()
 {
     TestDataService::truncateSpecificTables(array('JobVacancy'));
     $jobVacancy = new JobVacancy();
     $jobVacancy->jobTitleCode = 2;
     $jobVacancy->name = "BA 2010";
     $jobVacancy->hiringManagerId = 2;
     $jobVacancy->noOfPositions = 2;
     $jobVacancy->description = "test";
     $jobVacancy->status = 1;
     $jobVacancy->definedTime = "2011-08-09 10:38:39";
     $jobVacancy->updatedTime = "2011-08-09 10:38:39";
     $result = $this->vacancyDao->saveJobVacancy($jobVacancy);
     $this->assertTrue($result);
 }
Esempio n. 8
0
 /**
  * Testing saveTimesheetActionLog mthod for newly made timesheet action logs
  */
 public function testSaveTimesheetActionLogWithNewTimesheetActionLog()
 {
     TestDataService::truncateSpecificTables(array('TimesheetActionLog'), true);
     $timesheetActionLog = new TimesheetActionLog();
     $timesheetActionLog->setTimesheetId(1);
     $timesheetActionLog->setDateTime('2011-04-23');
     $timesheetActionLog->setComment('New Timesheet Item');
     $timesheetActionLog->setAction('ACCEPTED');
     $timesheetActionLog->setPerformedBy('3');
     $savedNewTimesheetActionLog = $this->timesheetDao->saveTimesheetActionLog($timesheetActionLog);
     $this->assertTrue($savedNewTimesheetActionLog instanceof TimesheetActionLog);
     $this->assertEquals('001', $savedNewTimesheetActionLog->getTimesheetActionLogId());
     $this->assertEquals($timesheetActionLog->getTimesheetId(), $savedNewTimesheetActionLog->getTimesheetId());
     $this->assertEquals($timesheetActionLog->getDateTime(), $savedNewTimesheetActionLog->getDateTime());
     $this->assertEquals($timesheetActionLog->getComment(), $savedNewTimesheetActionLog->getComment());
     $this->assertEquals($timesheetActionLog->getAction(), $savedNewTimesheetActionLog->getAction());
     $this->assertEquals($timesheetActionLog->getPerformedBy(), $savedNewTimesheetActionLog->getPerformedBy());
 }
 /**
  * 
  */
 public function testSaveCandidateAttachmentForNullId()
 {
     TestDataService::truncateSpecificTables(array('JobCandidateAttachment'));
     $file = tmpfile();
     fwrite($file, "writing to tempfile");
     fseek($file, 0);
     $resume = new JobCandidateAttachment();
     $resume->setId(null);
     $resume->setCandidateId(1);
     $resume->setFileName('xyz.txt');
     $resume->setFileType('.txt');
     $resume->setFileSize('512');
     $return = $this->recruitmentAttachmentDao->saveCandidateAttachment($resume);
     $this->assertTrue($return);
 }
Esempio n. 10
0
 /**
  * Set up method
  */
 protected function setUp()
 {
     $this->attendanceDao = new AttendanceDao();
     TestDataService::truncateSpecificTables(array('AttendanceRecord', 'Employee'));
     TestDataService::populate(sfConfig::get('sf_plugins_dir') . '/orangehrmAttendancePlugin/test/fixtures/AttendanceDao.yml');
 }