| @@ 1151-1176 (lines=26) @@ | ||
| 1148 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1149 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1150 | */ |
|
| 1151 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1152 | { |
|
| 1153 | $this->assertCount(3, $locations->locations); |
|
| 1154 | $this->assertEquals(5, $locations->totalCount); |
|
| 1155 | ||
| 1156 | foreach ($locations->locations as $location) { |
|
| 1157 | $this->assertInstanceOf( |
|
| 1158 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1159 | $location |
|
| 1160 | ); |
|
| 1161 | } |
|
| 1162 | ||
| 1163 | $this->assertEquals( |
|
| 1164 | [ |
|
| 1165 | $this->generateId('location', 14), |
|
| 1166 | $this->generateId('location', 44), |
|
| 1167 | $this->generateId('location', 61), |
|
| 1168 | ], |
|
| 1169 | array_map( |
|
| 1170 | function (Location $location) { |
|
| 1171 | return $location->id; |
|
| 1172 | }, |
|
| 1173 | $locations->locations |
|
| 1174 | ) |
|
| 1175 | ); |
|
| 1176 | } |
|
| 1177 | ||
| 1178 | /** |
|
| 1179 | * Test for the loadLocationChildren() method. |
|
| @@ 1215-1239 (lines=25) @@ | ||
| 1212 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1213 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1214 | */ |
|
| 1215 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1216 | { |
|
| 1217 | $this->assertCount(2, $locations->locations); |
|
| 1218 | $this->assertEquals(5, $locations->totalCount); |
|
| 1219 | ||
| 1220 | foreach ($locations->locations as $location) { |
|
| 1221 | $this->assertInstanceOf( |
|
| 1222 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1223 | $location |
|
| 1224 | ); |
|
| 1225 | } |
|
| 1226 | ||
| 1227 | $this->assertEquals( |
|
| 1228 | [ |
|
| 1229 | $this->generateId('location', 14), |
|
| 1230 | $this->generateId('location', 44), |
|
| 1231 | ], |
|
| 1232 | array_map( |
|
| 1233 | function (Location $location) { |
|
| 1234 | return $location->id; |
|
| 1235 | }, |
|
| 1236 | $locations->locations |
|
| 1237 | ) |
|
| 1238 | ); |
|
| 1239 | } |
|
| 1240 | ||
| 1241 | /** |
|
| 1242 | * Test for the newLocationUpdateStruct() method. |
|