本文整理汇总了PHP中TestDataService::truncateSpecificTables方法的典型用法代码示例。如果您正苦于以下问题:PHP TestDataService::truncateSpecificTables方法的具体用法?PHP TestDataService::truncateSpecificTables怎么用?PHP TestDataService::truncateSpecificTables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestDataService
的用法示例。
在下文中一共展示了TestDataService::truncateSpecificTables方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* 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();
}
示例2: setUp
/**
* 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();
}
示例3: setUp
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();
}
示例4: setUp
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();
}
示例5: testSaveLeaveTypeWithoutOperationalCountry
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()));
}
示例6: testSaveCandidateHistory
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);
}
示例7: testSaveJobVacancy
/**
* 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);
}
示例8: testSaveTimesheetActionLogWithNewTimesheetActionLog
/**
* 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());
}
示例9: testSaveCandidateAttachmentForNullId
/**
*
*/
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);
}
示例10: setUp
/**
* 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');
}