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