| @@ 1067-1092 (lines=26) @@ | ||
| 1064 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1065 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1066 | */ |
|
| 1067 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1068 | { |
|
| 1069 | $this->assertCount(3, $locations->locations); |
|
| 1070 | $this->assertEquals(5, $locations->totalCount); |
|
| 1071 | ||
| 1072 | foreach ($locations->locations as $location) { |
|
| 1073 | $this->assertInstanceOf( |
|
| 1074 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1075 | $location |
|
| 1076 | ); |
|
| 1077 | } |
|
| 1078 | ||
| 1079 | $this->assertEquals( |
|
| 1080 | [ |
|
| 1081 | $this->generateId('location', 14), |
|
| 1082 | $this->generateId('location', 44), |
|
| 1083 | $this->generateId('location', 61), |
|
| 1084 | ], |
|
| 1085 | array_map( |
|
| 1086 | function (Location $location) { |
|
| 1087 | return $location->id; |
|
| 1088 | }, |
|
| 1089 | $locations->locations |
|
| 1090 | ) |
|
| 1091 | ); |
|
| 1092 | } |
|
| 1093 | ||
| 1094 | /** |
|
| 1095 | * Test for the loadLocationChildren() method. |
|
| @@ 1131-1155 (lines=25) @@ | ||
| 1128 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1129 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1130 | */ |
|
| 1131 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1132 | { |
|
| 1133 | $this->assertCount(2, $locations->locations); |
|
| 1134 | $this->assertEquals(5, $locations->totalCount); |
|
| 1135 | ||
| 1136 | foreach ($locations->locations as $location) { |
|
| 1137 | $this->assertInstanceOf( |
|
| 1138 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1139 | $location |
|
| 1140 | ); |
|
| 1141 | } |
|
| 1142 | ||
| 1143 | $this->assertEquals( |
|
| 1144 | [ |
|
| 1145 | $this->generateId('location', 14), |
|
| 1146 | $this->generateId('location', 44), |
|
| 1147 | ], |
|
| 1148 | array_map( |
|
| 1149 | function (Location $location) { |
|
| 1150 | return $location->id; |
|
| 1151 | }, |
|
| 1152 | $locations->locations |
|
| 1153 | ) |
|
| 1154 | ); |
|
| 1155 | } |
|
| 1156 | ||
| 1157 | /** |
|
| 1158 | * Test for the newLocationUpdateStruct() method. |
|