| @@ 1059-1084 (lines=26) @@ | ||
| 1056 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1057 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1058 | */ |
|
| 1059 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1060 | { |
|
| 1061 | $this->assertEquals(3, count($locations->locations)); |
|
| 1062 | $this->assertEquals(5, $locations->totalCount); |
|
| 1063 | ||
| 1064 | foreach ($locations->locations as $location) { |
|
| 1065 | $this->assertInstanceOf( |
|
| 1066 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1067 | $location |
|
| 1068 | ); |
|
| 1069 | } |
|
| 1070 | ||
| 1071 | $this->assertEquals( |
|
| 1072 | [ |
|
| 1073 | $this->generateId('location', 14), |
|
| 1074 | $this->generateId('location', 44), |
|
| 1075 | $this->generateId('location', 61), |
|
| 1076 | ], |
|
| 1077 | array_map( |
|
| 1078 | function (Location $location) { |
|
| 1079 | return $location->id; |
|
| 1080 | }, |
|
| 1081 | $locations->locations |
|
| 1082 | ) |
|
| 1083 | ); |
|
| 1084 | } |
|
| 1085 | ||
| 1086 | /** |
|
| 1087 | * Test for the loadLocationChildren() method. |
|
| @@ 1123-1147 (lines=25) @@ | ||
| 1120 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1121 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1122 | */ |
|
| 1123 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1124 | { |
|
| 1125 | $this->assertEquals(2, count($locations->locations)); |
|
| 1126 | $this->assertEquals(5, $locations->totalCount); |
|
| 1127 | ||
| 1128 | foreach ($locations->locations as $location) { |
|
| 1129 | $this->assertInstanceOf( |
|
| 1130 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1131 | $location |
|
| 1132 | ); |
|
| 1133 | } |
|
| 1134 | ||
| 1135 | $this->assertEquals( |
|
| 1136 | [ |
|
| 1137 | $this->generateId('location', 14), |
|
| 1138 | $this->generateId('location', 44), |
|
| 1139 | ], |
|
| 1140 | array_map( |
|
| 1141 | function (Location $location) { |
|
| 1142 | return $location->id; |
|
| 1143 | }, |
|
| 1144 | $locations->locations |
|
| 1145 | ) |
|
| 1146 | ); |
|
| 1147 | } |
|
| 1148 | ||
| 1149 | /** |
|
| 1150 | * Test for the newLocationUpdateStruct() method. |
|