|
@@ 1149-1168 (lines=20) @@
|
| 1146 |
|
* @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
| 1147 |
|
* @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren |
| 1148 |
|
*/ |
| 1149 |
|
public function testLoadLocationChildrenWithOffset() |
| 1150 |
|
{ |
| 1151 |
|
$repository = $this->getRepository(); |
| 1152 |
|
|
| 1153 |
|
$locationId = $this->generateId('location', 5); |
| 1154 |
|
/* BEGIN: Use Case */ |
| 1155 |
|
// $locationId is the ID of an existing location |
| 1156 |
|
$locationService = $repository->getLocationService(); |
| 1157 |
|
|
| 1158 |
|
$location = $locationService->loadLocation($locationId); |
| 1159 |
|
|
| 1160 |
|
$childLocations = $locationService->loadLocationChildren($location, 2); |
| 1161 |
|
/* END: Use Case */ |
| 1162 |
|
|
| 1163 |
|
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations); |
| 1164 |
|
$this->assertInternalType('array', $childLocations->locations); |
| 1165 |
|
$this->assertInternalType('int', $childLocations->totalCount); |
| 1166 |
|
|
| 1167 |
|
return $childLocations; |
| 1168 |
|
} |
| 1169 |
|
|
| 1170 |
|
/** |
| 1171 |
|
* Test for the loadLocationChildren() method. |
|
@@ 1213-1232 (lines=20) @@
|
| 1210 |
|
* @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
| 1211 |
|
* @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren |
| 1212 |
|
*/ |
| 1213 |
|
public function testLoadLocationChildrenWithOffsetAndLimit() |
| 1214 |
|
{ |
| 1215 |
|
$repository = $this->getRepository(); |
| 1216 |
|
|
| 1217 |
|
$locationId = $this->generateId('location', 5); |
| 1218 |
|
/* BEGIN: Use Case */ |
| 1219 |
|
// $locationId is the ID of an existing location |
| 1220 |
|
$locationService = $repository->getLocationService(); |
| 1221 |
|
|
| 1222 |
|
$location = $locationService->loadLocation($locationId); |
| 1223 |
|
|
| 1224 |
|
$childLocations = $locationService->loadLocationChildren($location, 2, 2); |
| 1225 |
|
/* END: Use Case */ |
| 1226 |
|
|
| 1227 |
|
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations); |
| 1228 |
|
$this->assertInternalType('array', $childLocations->locations); |
| 1229 |
|
$this->assertInternalType('int', $childLocations->totalCount); |
| 1230 |
|
|
| 1231 |
|
return $childLocations; |
| 1232 |
|
} |
| 1233 |
|
|
| 1234 |
|
/** |
| 1235 |
|
* Test for the loadLocationChildren() method. |