| @@ 976-1001 (lines=26) @@ | ||
| 973 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 974 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 975 | */ |
|
| 976 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 977 | { |
|
| 978 | $this->assertEquals(3, count($locations->locations)); |
|
| 979 | $this->assertEquals(5, $locations->totalCount); |
|
| 980 | ||
| 981 | foreach ($locations->locations as $location) { |
|
| 982 | $this->assertInstanceOf( |
|
| 983 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 984 | $location |
|
| 985 | ); |
|
| 986 | } |
|
| 987 | ||
| 988 | $this->assertEquals( |
|
| 989 | array( |
|
| 990 | $this->generateId('location', 14), |
|
| 991 | $this->generateId('location', 44), |
|
| 992 | $this->generateId('location', 61), |
|
| 993 | ), |
|
| 994 | array_map( |
|
| 995 | function (Location $location) { |
|
| 996 | return $location->id; |
|
| 997 | }, |
|
| 998 | $locations->locations |
|
| 999 | ) |
|
| 1000 | ); |
|
| 1001 | } |
|
| 1002 | ||
| 1003 | /** |
|
| 1004 | * Test for the loadLocationChildren() method. |
|
| @@ 1040-1064 (lines=25) @@ | ||
| 1037 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 1038 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 1039 | */ |
|
| 1040 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 1041 | { |
|
| 1042 | $this->assertEquals(2, count($locations->locations)); |
|
| 1043 | $this->assertEquals(5, $locations->totalCount); |
|
| 1044 | ||
| 1045 | foreach ($locations->locations as $location) { |
|
| 1046 | $this->assertInstanceOf( |
|
| 1047 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 1048 | $location |
|
| 1049 | ); |
|
| 1050 | } |
|
| 1051 | ||
| 1052 | $this->assertEquals( |
|
| 1053 | array( |
|
| 1054 | $this->generateId('location', 14), |
|
| 1055 | $this->generateId('location', 44), |
|
| 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 newLocationUpdateStruct() method. |
|