| @@ 1178-1203 (lines=26) @@ | ||
| 1175 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1176 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1177 | */ |
|
| 1178 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1179 | { |
|
| 1180 | $this->assertEquals(3, count($locations->locations)); |
|
| 1181 | $this->assertEquals(5, $locations->totalCount); |
|
| 1182 | ||
| 1183 | foreach ($locations->locations as $location) { |
|
| 1184 | $this->assertInstanceOf( |
|
| 1185 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1186 | $location |
|
| 1187 | ); |
|
| 1188 | } |
|
| 1189 | ||
| 1190 | $this->assertEquals( |
|
| 1191 | [ |
|
| 1192 | $this->generateId('location', 14), |
|
| 1193 | $this->generateId('location', 44), |
|
| 1194 | $this->generateId('location', 61), |
|
| 1195 | ], |
|
| 1196 | array_map( |
|
| 1197 | function (Location $location) { |
|
| 1198 | return $location->id; |
|
| 1199 | }, |
|
| 1200 | $locations->locations |
|
| 1201 | ) |
|
| 1202 | ); |
|
| 1203 | } |
|
| 1204 | ||
| 1205 | /** |
|
| 1206 | * Test for the loadLocationChildren() method. |
|
| @@ 1242-1266 (lines=25) @@ | ||
| 1239 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1240 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1241 | */ |
|
| 1242 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1243 | { |
|
| 1244 | $this->assertEquals(2, count($locations->locations)); |
|
| 1245 | $this->assertEquals(5, $locations->totalCount); |
|
| 1246 | ||
| 1247 | foreach ($locations->locations as $location) { |
|
| 1248 | $this->assertInstanceOf( |
|
| 1249 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1250 | $location |
|
| 1251 | ); |
|
| 1252 | } |
|
| 1253 | ||
| 1254 | $this->assertEquals( |
|
| 1255 | [ |
|
| 1256 | $this->generateId('location', 14), |
|
| 1257 | $this->generateId('location', 44), |
|
| 1258 | ], |
|
| 1259 | array_map( |
|
| 1260 | function (Location $location) { |
|
| 1261 | return $location->id; |
|
| 1262 | }, |
|
| 1263 | $locations->locations |
|
| 1264 | ) |
|
| 1265 | ); |
|
| 1266 | } |
|
| 1267 | ||
| 1268 | /** |
|
| 1269 | * Test for the newLocationUpdateStruct() method. |
|