本文整理汇总了PHP中TestDataService::loadObjectListFromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP TestDataService::loadObjectListFromArray方法的具体用法?PHP TestDataService::loadObjectListFromArray怎么用?PHP TestDataService::loadObjectListFromArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestDataService
的用法示例。
在下文中一共展示了TestDataService::loadObjectListFromArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSearchHolidaysRecurringPartYear
public function testSearchHolidaysRecurringPartYear()
{
$fixture = array(array('id' => 2, 'recurring' => 1, 'description' => 'Public Holiday', 'date' => '2008-04-01', 'length' => 8), array('id' => 4, 'recurring' => 1, 'description' => 'Public Holiday', 'date' => '2010-06-27', 'length' => 8), array('id' => 5, 'recurring' => 0, 'description' => 'Another Holiday', 'date' => '2010-09-13', 'length' => 8), array('id' => 7, 'recurring' => 1, 'description' => 'Another Holiday', 'date' => '2012-09-13', 'length' => 8));
$holidays = TestDataService::loadObjectListFromArray('Holiday', $fixture);
$holidayDao = $this->getMock('HolidayDao', array('searchHolidays'));
$holidayDao->expects($this->once())->method('searchHolidays')->will($this->returnValue($holidays));
$this->holidayService->setHolidayDao($holidayDao);
$result = $this->holidayService->searchHolidays("2010-06-11", "2010-11-02");
$expectedArray = array(array('id' => 4, 'recurring' => 1, 'description' => 'Public Holiday', 'date' => '2010-06-27', 'length' => 8), array('id' => 7, 'recurring' => 1, 'description' => 'Another Holiday', 'date' => '2010-09-13', 'length' => 8), array('id' => 5, 'recurring' => 0, 'description' => 'Another Holiday', 'date' => '2010-09-13', 'length' => 8));
$expected = TestDataService::loadObjectListFromArray('Holiday', $expectedArray);
$this->compareHolidays($expected, $result);
}