本文整理汇总了PHP中TestDataService::loadObjectList方法的典型用法代码示例。如果您正苦于以下问题:PHP TestDataService::loadObjectList方法的具体用法?PHP TestDataService::loadObjectList怎么用?PHP TestDataService::loadObjectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestDataService
的用法示例。
在下文中一共展示了TestDataService::loadObjectList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSanitizeNotificationSection
public function testSanitizeNotificationSection()
{
$notifications = TestDataService::loadObjectList('BeaconNotification', $this->fixture, 'BeaconNotification');
$notificationXML = new SimpleXMLElement($notifications[0]->getDefinition());
$sanitizedBody = $this->beaconNotificationService->sanitizeNotificationSection($notificationXML->content->body . "");
$this->assertTrue(substr_count($sanitizedBody, '<script>') == 0);
}
示例2: testGetAllCustomers
public function testGetAllCustomers()
{
$customerList = TestDataService::loadObjectList('Customer', $this->fixture, 'Customer');
$customerDao = $this->getMock('CustomerDao');
$customerDao->expects($this->once())->method('getAllCustomers')->with(false)->will($this->returnValue($customerList));
$this->customerService->setCustomerDao($customerDao);
$result = $this->customerService->getAllCustomers(false);
$this->assertEquals($result, $customerList);
}
示例3: testGtJobCategoryById
public function testGtJobCategoryById()
{
$jobCatList = TestDataService::loadObjectList('JobCategory', $this->fixture, 'JobCategory');
$jobCatDao = $this->getMock('JobCategoryDao');
$jobCatDao->expects($this->once())->method('getJobCategoryById')->with(1)->will($this->returnValue($jobCatList[0]));
$this->jobCatService->setJobCategoryDao($jobCatDao);
$result = $this->jobCatService->getJobCategoryById(1);
$this->assertEquals($result, $jobCatList[0]);
}
示例4: testGetJobTitleById
public function testGetJobTitleById()
{
$jobTitleList = TestDataService::loadObjectList('JobTitle', $this->fixture, 'JobTitle');
$jobTitleDao = $this->getMock('JobTitleDao');
$jobTitleDao->expects($this->once())->method('getJobTitleById')->with(1)->will($this->returnValue($jobTitleList[0]));
$this->JobTitleService->setJobTitleDao($jobTitleDao);
$result = $this->JobTitleService->getJobTitleById(1);
$this->assertEquals($jobTitleList[0], $result);
}
示例5: testUpdateWorkShift
public function testUpdateWorkShift()
{
$workShiftList = TestDataService::loadObjectList('WorkShift', $this->fixture, 'WorkShift');
$workShiftDao = $this->getMock('WorkShiftDao');
$workShiftDao->expects($this->once())->method('updateWorkShift')->with($workShiftList[0])->will($this->returnValue(true));
$this->workShiftService->setWorkShiftDao($workShiftDao);
$result = $this->workShiftService->updateWorkShift($workShiftList[0]);
$this->assertTrue($result);
}
示例6: testGetValue
/**
* Testing getValue()
*/
public function testGetValue()
{
// Test values in fixtures.yml
$fixtureObjects = TestDataService::loadObjectList('Config', $this->fixture, 'Config');
foreach ($fixtureObjects as $config) {
$value = $this->configDao->getValue($config->key);
$this->assertEquals($config->value, $value);
}
}
示例7: testGetMembershipById
public function testGetMembershipById()
{
$membershipList = TestDataService::loadObjectList('Membership', $this->fixture, 'Membership');
$membershipDao = $this->getMock('MembershipDao');
$membershipDao->expects($this->once())->method('getMembershipById')->with(1)->will($this->returnValue($membershipList[0]));
$this->membershipService->setMembershipDao($membershipDao);
$result = $this->membershipService->getMembershipById(1);
$this->assertEquals($result, $membershipList[0]);
}
示例8: testGetNationalityById
public function testGetNationalityById()
{
$nationalityList = TestDataService::loadObjectList('Nationality', $this->fixture, 'Nationality');
$nationalityDao = $this->getMock('NationalityDao');
$nationalityDao->expects($this->once())->method('getNationalityById')->with(1)->will($this->returnValue($nationalityList[0]));
$this->nationalityService->setNationalityDao($nationalityDao);
$result = $this->nationalityService->getNationalityById(1);
$this->assertEquals($result, $nationalityList[0]);
}
示例9: testGetEmploymentStatusById
public function testGetEmploymentStatusById()
{
$empStatusList = TestDataService::loadObjectList('EmploymentStatus', $this->fixture, 'EmploymentStatus');
$empStatusDao = $this->getMock('EmploymentStatusDao');
$empStatusDao->expects($this->once())->method('getEmploymentStatusById')->with(1)->will($this->returnValue($empStatusList[0]));
$this->empStatService->setEmploymentStatusDao($empStatusDao);
$result = $this->empStatService->getEmploymentStatusById(1);
$this->assertEquals($result, $empStatusList[0]);
}
示例10: testAddSubunit
public function testAddSubunit()
{
$subunitList = TestDataService::loadObjectList('Subunit', $this->fixture, 'Subunit');
$subunit = $subunitList[2];
$parentSubunit = new Subunit();
$parentSubunit->setName("New Department");
$this->assertTrue($this->companyStructureDao->addSubunit($parentSubunit, $subunit));
$this->assertNotNull($parentSubunit->getId());
}
示例11: testGetLocationList
public function testGetLocationList()
{
$locationList = TestDataService::loadObjectList('Location', $this->fixture, 'Location');
$locationDao = $this->getMock('LocationDao');
$locationDao->expects($this->once())->method('getLocationList')->will($this->returnValue($locationList));
$this->locationService->setLocationDao($locationDao);
$result = $this->locationService->getLocationList();
$this->assertEquals($result, $locationList);
}
示例12: testSavePunchAction
/**
* @group orangehrmAttendancePlugin
*/
public function testSavePunchAction()
{
$attendanceRecords = TestDataService::loadObjectList('AttendanceRecord', $this->fixture, 'AttendanceRecord');
$attendanceRecord = $attendanceRecords[0];
$attendanceDaoMock = $this->getMock('AttendanceDao', array('savePunchRecord'));
$attendanceDaoMock->expects($this->once())->method('savePunchRecord')->with($attendanceRecord)->will($this->returnValue($attendanceRecord));
$this->attendanceService->setAttendanceDao($attendanceDaoMock);
$this->assertTrue($this->attendanceService->savePunchRecord($attendanceRecord) instanceof AttendanceRecord);
}
示例13: testReadWorkWeek
public function testReadWorkWeek()
{
$workWeekList = TestDataService::loadObjectList('WorkWeek', $this->fixture, 'WorkWeek');
$workWeekDao = $this->getMock('WorkWeekDao', array('readWorkWeek'));
$workWeekDao->expects($this->once())->method('readWorkWeek')->with(1)->will($this->returnValue($workWeekList[0]));
$this->workWeekService->setWorkWeekDao($workWeekDao);
$readWorkWeek = $this->workWeekService->readWorkWeek(1);
$this->assertTrue($readWorkWeek instanceof WorkWeek);
$this->assertEquals($workWeekList[0], $readWorkWeek);
}
示例14: testReadLeaveType
public function testReadLeaveType()
{
$leaveTypeList = TestDataService::loadObjectList('LeaveType', $this->fixture, 'set1');
$leaveType = $leaveTypeList[0];
$leaveTypeDao = $this->getMock('LeaveTypeDao', array('readLeaveType'));
$leaveTypeDao->expects($this->once())->method('readLeaveType')->with('LTY001')->will($this->returnValue($leaveType));
$this->leaveTypeService->setLeaveTypeDao($leaveTypeDao);
$leaveType = $this->leaveTypeService->readLeaveType('LTY001');
$this->assertTrue($leaveType instanceof LeaveType);
}
示例15: testGetAllValues
public function testGetAllValues()
{
$result = $this->configDao->getAllValues();
// Test values in fixtures.yml
$fixtureObjects = TestDataService::loadObjectList('Config', $this->fixture, 'Config');
foreach ($fixtureObjects as $config) {
$this->assertTrue(isset($result[$config->key]));
$this->assertEquals($config->value, $result[$config->key]);
}
$this->assertEquals(count($fixtureObjects), count($result));
}