|
@@ 1077-1096 (lines=20) @@
|
| 1074 |
|
* @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
| 1075 |
|
* @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren |
| 1076 |
|
*/ |
| 1077 |
|
public function testLoadLocationChildrenWithOffset() |
| 1078 |
|
{ |
| 1079 |
|
$repository = $this->getRepository(); |
| 1080 |
|
|
| 1081 |
|
$locationId = $this->generateId('location', 5); |
| 1082 |
|
/* BEGIN: Use Case */ |
| 1083 |
|
// $locationId is the ID of an existing location |
| 1084 |
|
$locationService = $repository->getLocationService(); |
| 1085 |
|
|
| 1086 |
|
$location = $locationService->loadLocation($locationId); |
| 1087 |
|
|
| 1088 |
|
$childLocations = $locationService->loadLocationChildren($location, 2); |
| 1089 |
|
/* END: Use Case */ |
| 1090 |
|
|
| 1091 |
|
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations); |
| 1092 |
|
$this->assertInternalType('array', $childLocations->locations); |
| 1093 |
|
$this->assertInternalType('int', $childLocations->totalCount); |
| 1094 |
|
|
| 1095 |
|
return $childLocations; |
| 1096 |
|
} |
| 1097 |
|
|
| 1098 |
|
/** |
| 1099 |
|
* Test for the loadLocationChildren() method. |
|
@@ 1141-1160 (lines=20) @@
|
| 1138 |
|
* @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
| 1139 |
|
* @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren |
| 1140 |
|
*/ |
| 1141 |
|
public function testLoadLocationChildrenWithOffsetAndLimit() |
| 1142 |
|
{ |
| 1143 |
|
$repository = $this->getRepository(); |
| 1144 |
|
|
| 1145 |
|
$locationId = $this->generateId('location', 5); |
| 1146 |
|
/* BEGIN: Use Case */ |
| 1147 |
|
// $locationId is the ID of an existing location |
| 1148 |
|
$locationService = $repository->getLocationService(); |
| 1149 |
|
|
| 1150 |
|
$location = $locationService->loadLocation($locationId); |
| 1151 |
|
|
| 1152 |
|
$childLocations = $locationService->loadLocationChildren($location, 2, 2); |
| 1153 |
|
/* END: Use Case */ |
| 1154 |
|
|
| 1155 |
|
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations); |
| 1156 |
|
$this->assertInternalType('array', $childLocations->locations); |
| 1157 |
|
$this->assertInternalType('int', $childLocations->totalCount); |
| 1158 |
|
|
| 1159 |
|
return $childLocations; |
| 1160 |
|
} |
| 1161 |
|
|
| 1162 |
|
/** |
| 1163 |
|
* Test for the loadLocationChildren() method. |