| @@ 1143-1168 (lines=26) @@ | ||
| 1140 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1141 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1142 | */ |
|
| 1143 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1144 | { |
|
| 1145 | $this->assertEquals(3, count($locations->locations)); |
|
| 1146 | $this->assertEquals(5, $locations->totalCount); |
|
| 1147 | ||
| 1148 | foreach ($locations->locations as $location) { |
|
| 1149 | $this->assertInstanceOf( |
|
| 1150 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1151 | $location |
|
| 1152 | ); |
|
| 1153 | } |
|
| 1154 | ||
| 1155 | $this->assertEquals( |
|
| 1156 | [ |
|
| 1157 | $this->generateId('location', 14), |
|
| 1158 | $this->generateId('location', 44), |
|
| 1159 | $this->generateId('location', 61), |
|
| 1160 | ], |
|
| 1161 | array_map( |
|
| 1162 | function (Location $location) { |
|
| 1163 | return $location->id; |
|
| 1164 | }, |
|
| 1165 | $locations->locations |
|
| 1166 | ) |
|
| 1167 | ); |
|
| 1168 | } |
|
| 1169 | ||
| 1170 | /** |
|
| 1171 | * Test for the loadLocationChildren() method. |
|
| @@ 1207-1231 (lines=25) @@ | ||
| 1204 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1205 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1206 | */ |
|
| 1207 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1208 | { |
|
| 1209 | $this->assertEquals(2, count($locations->locations)); |
|
| 1210 | $this->assertEquals(5, $locations->totalCount); |
|
| 1211 | ||
| 1212 | foreach ($locations->locations as $location) { |
|
| 1213 | $this->assertInstanceOf( |
|
| 1214 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1215 | $location |
|
| 1216 | ); |
|
| 1217 | } |
|
| 1218 | ||
| 1219 | $this->assertEquals( |
|
| 1220 | [ |
|
| 1221 | $this->generateId('location', 14), |
|
| 1222 | $this->generateId('location', 44), |
|
| 1223 | ], |
|
| 1224 | array_map( |
|
| 1225 | function (Location $location) { |
|
| 1226 | return $location->id; |
|
| 1227 | }, |
|
| 1228 | $locations->locations |
|
| 1229 | ) |
|
| 1230 | ); |
|
| 1231 | } |
|
| 1232 | ||
| 1233 | /** |
|
| 1234 | * Test for the newLocationUpdateStruct() method. |
|