当前位置: 首页>>代码示例>>PHP>>正文


PHP TestDataService::getRecords方法代码示例

本文整理汇总了PHP中TestDataService::getRecords方法的典型用法代码示例。如果您正苦于以下问题:PHP TestDataService::getRecords方法的具体用法?PHP TestDataService::getRecords怎么用?PHP TestDataService::getRecords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestDataService的用法示例。


在下文中一共展示了TestDataService::getRecords方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCalculateDaysInTheTimesheetPeriod

 public function testCalculateDaysInTheTimesheetPeriod()
 {
     $key = 'timesheet_period_and_start_date';
     $xmlString = TestDataService::getRecords("SELECT value from hs_hr_config WHERE `key` = '" . $key . "'");
     $xmlString = $xmlString[0]['value'];
     $xmlString = simplexml_load_String($xmlString);
     $currentDate = '2011-04-24';
     // This is necessary to make timeStampDiff 0 in MonthlyTimesheetPeriod::getDatesOfTheTimesheetPeriod
     // $timeStampDiff = $clientTimeZoneOffset * 3600 - $serverTimezoneOffset;
     $serverTimezoneOffset = (int) date('Z');
     sfContext::getInstance()->getUser()->setAttribute('system.timeZoneOffset', $serverTimezoneOffset / 3600);
     $datesArray = $this->weeklyTimesheetPeriod->calculateDaysInTheTimesheetPeriod($currentDate, $xmlString);
     $this->assertEquals($datesArray[0], "2011-04-18 00:00");
     $this->assertEquals($datesArray[3], "2011-04-21 00:00");
     $this->assertEquals(end($datesArray), "2011-04-24 00:00");
     $currentDate = '2012-02-28';
     $datesArray = $this->weeklyTimesheetPeriod->calculateDaysInTheTimesheetPeriod($currentDate, $xmlString);
     $this->assertEquals($datesArray[0], "2012-02-27 00:00");
     $this->assertEquals($datesArray[3], "2012-03-01 00:00");
     $this->assertEquals(end($datesArray), "2012-03-04 00:00");
     $currentDate = '2011-12-29';
     $datesArray = $this->weeklyTimesheetPeriod->calculateDaysInTheTimesheetPeriod($currentDate, $xmlString);
     $this->assertEquals($datesArray[0], "2011-12-26 00:00");
     $this->assertEquals($datesArray[3], "2011-12-29 00:00");
     $this->assertEquals(end($datesArray), "2012-01-01 00:00");
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:26,代码来源:WeeklyTimesheetPeriodTest.php

示例2: validateResultRecords

 protected function validateResultRecords($originalQuery, $expectedQuery, $service, $method)
 {
     $resultQuery = self::$baseService->decorateQuery($service, $method, $originalQuery);
     $expectedRecords = TestDataService::getRecords($expectedQuery);
     $resultRecords = TestDataService::getRecords($resultQuery);
     $this->assertEquals($expectedRecords, $resultRecords);
     $this->resultRecords = $resultRecords;
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:8,代码来源:BaseServiceDataTest.php

示例3: testCalculateDaysInTheTimesheetPeriod

 public function testCalculateDaysInTheTimesheetPeriod()
 {
     $key = 'timesheet_period_and_start_date';
     $xmlString = TestDataService::getRecords("SELECT value from hs_hr_config WHERE `key` = '" . $key . "'");
     $xmlString = $xmlString[0]['value'];
     $xmlString = simplexml_load_String($xmlString);
     $currentDate = '2011-04-24';
     $dates = $this->monthlyTimesheetPeriod->calculateDaysInTheTimesheetPeriod($currentDate, $xmlString);
     $this->assertEquals("2011-04-13", $dates[0]);
     $this->assertEquals("2011-05-12", end($dates));
     $this->assertEquals("2011-04-18", $dates[5]);
     $dates = $this->monthlyTimesheetPeriod->calculateDaysInTheTimesheetPeriod("2011-02-18", $xmlString);
     $this->assertEquals("2011-02-13", $dates[0]);
     $this->assertEquals("2011-03-12", end($dates));
     $this->assertEquals("2011-02-23", $dates[10]);
     $dates = $this->monthlyTimesheetPeriod->calculateDaysInTheTimesheetPeriod("2012-02-18", $xmlString);
     $this->assertEquals("2012-02-13", $dates[0]);
     $this->assertEquals("2012-03-12", end($dates));
     $this->assertEquals("2012-02-28", $dates[15]);
     $dates = $this->monthlyTimesheetPeriod->calculateDaysInTheTimesheetPeriod("2012-12-31", $xmlString);
     $this->assertEquals("2012-12-13", $dates[0]);
     $this->assertEquals("2013-01-12", end($dates));
     $this->assertEquals("2013-01-02", $dates[20]);
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:24,代码来源:MonthlyTimesheetPeriodTest.php

示例4: testGetTimesheetHeading

 public function testGetTimesheetHeading()
 {
     $key = 'timesheet_period_and_start_date';
     // Note: fetchObject fails due to primary key 'key' being a reserved word.
     //$xmlString = TestDataService::fetchObject('Config', $key);
     $xmlString = TestDataService::getRecords("SELECT value from hs_hr_config WHERE `key` = '" . $key . "'");
     $value = $xmlString[0]['value'];
     $timesheetPeriodDaoMock = $this->getMock('TimesheetPeriodDao', array('getDefinedTimesheetPeriod'));
     $timesheetPeriodDaoMock->expects($this->once())->method('getDefinedTimesheetPeriod')->will($this->returnValue($value));
     $this->timesheetPeriodService->setTimesheetPeriodDao($timesheetPeriodDaoMock);
     $timesheetHeading = $this->timesheetPeriodService->getTimesheetHeading();
     $this->assertEquals("Week", (string) $timesheetHeading);
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:13,代码来源:TimesheetPeriodServiceTest.php


注:本文中的TestDataService::getRecords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。