| @@ 1106-1131 (lines=26) @@ | ||
| 1103 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1104 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1105 | */ |
|
| 1106 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1107 | { |
|
| 1108 | $this->assertEquals(3, count($locations->locations)); |
|
| 1109 | $this->assertEquals(5, $locations->totalCount); |
|
| 1110 | ||
| 1111 | foreach ($locations->locations as $location) { |
|
| 1112 | $this->assertInstanceOf( |
|
| 1113 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1114 | $location |
|
| 1115 | ); |
|
| 1116 | } |
|
| 1117 | ||
| 1118 | $this->assertEquals( |
|
| 1119 | [ |
|
| 1120 | $this->generateId('location', 14), |
|
| 1121 | $this->generateId('location', 44), |
|
| 1122 | $this->generateId('location', 61), |
|
| 1123 | ], |
|
| 1124 | array_map( |
|
| 1125 | function (Location $location) { |
|
| 1126 | return $location->id; |
|
| 1127 | }, |
|
| 1128 | $locations->locations |
|
| 1129 | ) |
|
| 1130 | ); |
|
| 1131 | } |
|
| 1132 | ||
| 1133 | /** |
|
| 1134 | * Test for the loadLocationChildren() method. |
|
| @@ 1170-1194 (lines=25) @@ | ||
| 1167 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1168 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1169 | */ |
|
| 1170 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1171 | { |
|
| 1172 | $this->assertEquals(2, count($locations->locations)); |
|
| 1173 | $this->assertEquals(5, $locations->totalCount); |
|
| 1174 | ||
| 1175 | foreach ($locations->locations as $location) { |
|
| 1176 | $this->assertInstanceOf( |
|
| 1177 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1178 | $location |
|
| 1179 | ); |
|
| 1180 | } |
|
| 1181 | ||
| 1182 | $this->assertEquals( |
|
| 1183 | [ |
|
| 1184 | $this->generateId('location', 14), |
|
| 1185 | $this->generateId('location', 44), |
|
| 1186 | ], |
|
| 1187 | array_map( |
|
| 1188 | function (Location $location) { |
|
| 1189 | return $location->id; |
|
| 1190 | }, |
|
| 1191 | $locations->locations |
|
| 1192 | ) |
|
| 1193 | ); |
|
| 1194 | } |
|
| 1195 | ||
| 1196 | /** |
|
| 1197 | * Test for the newLocationUpdateStruct() method. |
|