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