| @@ 1039-1064 (lines=26) @@ | ||
| 1036 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 1037 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 1038 | */ |
|
| 1039 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 1040 | { |
|
| 1041 | $this->assertEquals(3, count($locations->locations)); |
|
| 1042 | $this->assertEquals(5, $locations->totalCount); |
|
| 1043 | ||
| 1044 | foreach ($locations->locations as $location) { |
|
| 1045 | $this->assertInstanceOf( |
|
| 1046 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1047 | $location |
|
| 1048 | ); |
|
| 1049 | } |
|
| 1050 | ||
| 1051 | $this->assertEquals( |
|
| 1052 | array( |
|
| 1053 | $this->generateId('location', 14), |
|
| 1054 | $this->generateId('location', 44), |
|
| 1055 | $this->generateId('location', 61), |
|
| 1056 | ), |
|
| 1057 | array_map( |
|
| 1058 | function (Location $location) { |
|
| 1059 | return $location->id; |
|
| 1060 | }, |
|
| 1061 | $locations->locations |
|
| 1062 | ) |
|
| 1063 | ); |
|
| 1064 | } |
|
| 1065 | ||
| 1066 | /** |
|
| 1067 | * Test for the loadLocationChildren() method. |
|
| @@ 1103-1127 (lines=25) @@ | ||
| 1100 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1101 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1102 | */ |
|
| 1103 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1104 | { |
|
| 1105 | $this->assertEquals(2, count($locations->locations)); |
|
| 1106 | $this->assertEquals(5, $locations->totalCount); |
|
| 1107 | ||
| 1108 | foreach ($locations->locations as $location) { |
|
| 1109 | $this->assertInstanceOf( |
|
| 1110 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1111 | $location |
|
| 1112 | ); |
|
| 1113 | } |
|
| 1114 | ||
| 1115 | $this->assertEquals( |
|
| 1116 | array( |
|
| 1117 | $this->generateId('location', 14), |
|
| 1118 | $this->generateId('location', 44), |
|
| 1119 | ), |
|
| 1120 | array_map( |
|
| 1121 | function (Location $location) { |
|
| 1122 | return $location->id; |
|
| 1123 | }, |
|
| 1124 | $locations->locations |
|
| 1125 | ) |
|
| 1126 | ); |
|
| 1127 | } |
|
| 1128 | ||
| 1129 | /** |
|
| 1130 | * Test for the newLocationUpdateStruct() method. |
|