當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestDataService::fetchObject方法代碼示例

本文整理匯總了PHP中TestDataService::fetchObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestDataService::fetchObject方法的具體用法?PHP TestDataService::fetchObject怎麽用?PHP TestDataService::fetchObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TestDataService的用法示例。


在下文中一共展示了TestDataService::fetchObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSavePunchRecordForExistingPunchRecord

 /**
  * @group orangehrmAttendancePlugin
  */
 public function testSavePunchRecordForExistingPunchRecord()
 {
     $attendanceRecord = TestDataService::fetchObject('AttendanceRecord', 1);
     $attendanceRecord->setState("PUNCHED IN");
     $saveRecord = $this->attendanceDao->savePunchRecord($attendanceRecord);
     $this->assertEquals($saveRecord->getState(), 'PUNCHED IN');
     $this->assertEquals($saveRecord->getPunchInTimeOffset(), 'Asia/Calcutta');
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:11,代碼來源:AttendanceDaoTest.php

示例2: testDeleteSubunit

 public function testDeleteSubunit()
 {
     $subunitList = TestDataService::loadObjectList('Subunit', $this->fixture, 'Subunit');
     $subunit = $subunitList[2];
     $this->assertTrue($this->companyStructureDao->deleteSubunit($subunit));
     $result = TestDataService::fetchObject('Subunit', 3);
     $this->assertFalse($result);
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:8,代碼來源:CompanyStructureDaoTest.php

示例3: testEditLanguage

 public function testEditLanguage()
 {
     $language = TestDataService::fetchObject('Language', 3);
     $language->setName('Canadian French');
     $this->languageDao->saveLanguage($language);
     $savedLanguage = TestDataService::fetchLastInsertedRecord('Language', 'id');
     $this->assertTrue($savedLanguage instanceof Language);
     $this->assertEquals('Canadian French', $savedLanguage->getName());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:9,代碼來源:LanguageDaoTest.php

示例4: testEditTerminationReason

 public function testEditTerminationReason()
 {
     $terminationReason = TestDataService::fetchObject('TerminationReason', 3);
     $terminationReason->setName('2011 Layed off');
     $this->terminationReasonDao->saveTerminationReason($terminationReason);
     $savedTerminationReason = TestDataService::fetchLastInsertedRecord('TerminationReason', 'id');
     $this->assertTrue($savedTerminationReason instanceof TerminationReason);
     $this->assertEquals('2011 Layed off', $savedTerminationReason->getName());
 }
開發者ID:rabbitdigital,項目名稱:HRM,代碼行數:9,代碼來源:TerminationReasonDaoTest.php

示例5: testEditLicense

 public function testEditLicense()
 {
     $license = TestDataService::fetchObject('License', 3);
     $license->setName('Moon Pilot');
     $this->licenseDao->saveLicense($license);
     $savedLicense = TestDataService::fetchLastInsertedRecord('License', 'id');
     $this->assertTrue($savedLicense instanceof License);
     $this->assertEquals('Moon Pilot', $savedLicense->getName());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:9,代碼來源:LicenseDaoTest.php

示例6: testEditReportingMethod

 public function testEditReportingMethod()
 {
     $reportingMethod = TestDataService::fetchObject('ReportingMethod', 3);
     $reportingMethod->setName('Finance HR');
     $this->reportingMethodDao->saveReportingMethod($reportingMethod);
     $savedReportingMethod = TestDataService::fetchLastInsertedRecord('ReportingMethod', 'id');
     $this->assertTrue($savedReportingMethod instanceof ReportingMethod);
     $this->assertEquals('Finance HR', $savedReportingMethod->getName());
 }
開發者ID:rabbitdigital,項目名稱:HRM,代碼行數:9,代碼來源:ReportingMethodDaoTest.php

示例7: testEditEducation

 public function testEditEducation()
 {
     $education = TestDataService::fetchObject('Education', 3);
     $education->setName('MSc New');
     $this->educationDao->saveEducation($education);
     $savedEducation = TestDataService::fetchLastInsertedRecord('Education', 'id');
     $this->assertTrue($savedEducation instanceof Education);
     $this->assertEquals('MSc New', $savedEducation->getName());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:9,代碼來源:EducationDaoTest.php

示例8: testEditSkill

 public function testEditSkill()
 {
     $skill = TestDataService::fetchObject('Skill', 3);
     $skill->setDescription('Ability to help disabled people');
     $this->skillDao->saveSkill($skill);
     $savedSkill = TestDataService::fetchLastInsertedRecord('Skill', 'id');
     $this->assertTrue($savedSkill instanceof Skill);
     $this->assertEquals('Sign Language', $savedSkill->getName());
     $this->assertEquals('Ability to help disabled people', $savedSkill->getDescription());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:10,代碼來源:SkillDaoTest.php

示例9: testUpdateModuleStatusWithNoChange

 public function testUpdateModuleStatusWithNoChange()
 {
     $moduleList = array('leave', 'time');
     $status = Module::ENABLED;
     $result = $this->moduleDao->updateModuleStatus($moduleList, $status);
     $this->assertEquals(0, $result);
     $module = TestDataService::fetchObject('Module', 3);
     $this->assertEquals(Module::ENABLED, $module->getStatus());
     $module = TestDataService::fetchObject('Module', 4);
     $this->assertEquals(Module::ENABLED, $module->getStatus());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:11,代碼來源:ModuleDaoTest.php

示例10: testDeleteSubunit

 public function testDeleteSubunit()
 {
     $subunit = TestDataService::fetchObject('Subunit', 1);
     $parentSubunit = new Subunit();
     $parentSubunit->setName("new subunit");
     $compStructureDao = $this->getMock('CompanyStructureDao');
     $compStructureDao->expects($this->once())->method('deleteSubunit')->with($subunit)->will($this->returnValue(true));
     $this->companyStructureService->setCompanyStructureDao($compStructureDao);
     $result = $this->companyStructureService->deleteSubunit($subunit);
     $this->assertTrue($result);
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:11,代碼來源:CompanyStructureServiceTest.php

示例11: testDeleteCustomFields

 public function testDeleteCustomFields()
 {
     $result = $this->customFieldConfigurationDao->deleteCustomFields(array(1, 3));
     $this->assertEquals(2, $result);
     /*Checking whether the correct fields were deleted*/
     $result = TestDataService::fetchObject('CustomField', 1);
     $this->assertTrue(empty($result));
     $result = TestDataService::fetchObject('CustomField', 3);
     $this->assertTrue(empty($result));
     $result = TestDataService::fetchObject('CustomField', 2);
     $this->assertTrue($result instanceof CustomField);
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:12,代碼來源:CustomFieldConfigurationDaoTest.php

示例12: testGetActionableStates

 public function testGetActionableStates()
 {
     $actions = array("APPROVE", "REJECT");
     $workFlow = "Time";
     $userRole = "ADMIN";
     $fetchedRecord1 = TestDataService::fetchObject('WorkflowStateMachine', 1);
     $fetchedRecord2 = TestDataService::fetchObject('WorkflowStateMachine', 5);
     $tempArray = array($fetchedRecord1, $fetchedRecord2);
     $acessFlowStateMachineDaoMock = $this->getMock('AccessFlowStateMachineDao', array('getActionableStates'));
     $acessFlowStateMachineDaoMock->expects($this->once())->method('getActionableStates')->with($workFlow, $userRole, $actions)->will($this->returnValue($tempArray));
     $this->accessFlowStateMachineService->setAccessFlowStateMachineDao($acessFlowStateMachineDaoMock);
     $record = $this->accessFlowStateMachineService->getActionableStates($workFlow, $userRole, $actions);
     $this->assertEquals(2, count($record));
     $this->assertEquals($fetchedRecord1->getState(), $record[0]);
     $this->assertEquals($fetchedRecord2->getState(), $record[1]);
 }
開發者ID:THM068,項目名稱:orangehrm,代碼行數:16,代碼來源:AccessFlowStateMachineServiceTest.php

示例13: testSaveLeavePeriodException

 public function testSaveLeavePeriodException()
 {
     $leavePeriod = TestDataService::fetchObject('LeavePeriod', 1);
     $leavePeriod->setStartDate("2008-01-31");
     $leavePeriod->setEndDate("2009-01-31");
     $leavePeriod->setLeavePeriodId("california");
     try {
         $this->leavePeriodDao->saveLeavePeriod($leavePeriod);
     } catch (Exception $e) {
         $this->assertTrue($e instanceof DaoException);
     }
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:12,代碼來源:LeavePeriodDaoTest.php

示例14: testCheckForMatchingTimesheetForCurrentDate

 public function testCheckForMatchingTimesheetForCurrentDate()
 {
     $employeeId = 6;
     $currentDate = "2011-02-24";
     $timesheetId = 9;
     $timesheet = TestDataService::fetchObject('Timesheet', $timesheetId);
     $timehseetDaoMock = $this->getMock('TimesheetDao', array('checkForMatchingTimesheetForCurrentDate'));
     $timehseetDaoMock->expects($this->once())->method('checkForMatchingTimesheetForCurrentDate')->with($employeeId, $currentDate)->will($this->returnValue($timesheet));
     $this->timesheetService->setTimesheetDao($timehseetDaoMock);
     $testTimesheet = $this->timesheetService->checkForMatchingTimesheetForCurrentDate($employeeId, $currentDate);
     $this->assertTrue($testTimesheet instanceof Timesheet);
     $this->assertEquals($timesheet, $testTimesheet);
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:13,代碼來源:TimesheetServiceTest.php

示例15: testUndeleteLeaveTypeValues

 public function testUndeleteLeaveTypeValues()
 {
     $this->assertTrue($this->leaveTypeDao->undeleteLeaveType('LTY003'));
     $undeletedTypeObject = TestDataService::fetchObject('LeaveType', 'LTY003');
     $this->assertEquals('LTY003', $undeletedTypeObject->getLeaveTypeId());
     $this->assertEquals(1, $undeletedTypeObject->getAvailableFlag());
 }
開發者ID:THM068,項目名稱:orangehrm,代碼行數:7,代碼來源:LeaveTypeDaoTest.php


注:本文中的TestDataService::fetchObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。