| @@ 913-938 (lines=26) @@ | ||
| 910 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 911 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 912 | */ |
|
| 913 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 914 | { |
|
| 915 | $this->assertEquals(3, count($locations->locations)); |
|
| 916 | $this->assertEquals(5, $locations->totalCount); |
|
| 917 | ||
| 918 | foreach ($locations->locations as $location) { |
|
| 919 | $this->assertInstanceOf( |
|
| 920 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 921 | $location |
|
| 922 | ); |
|
| 923 | } |
|
| 924 | ||
| 925 | $this->assertEquals( |
|
| 926 | array( |
|
| 927 | $this->generateId('location', 14), |
|
| 928 | $this->generateId('location', 44), |
|
| 929 | $this->generateId('location', 61), |
|
| 930 | ), |
|
| 931 | array_map( |
|
| 932 | function (Location $location) { |
|
| 933 | return $location->id; |
|
| 934 | }, |
|
| 935 | $locations->locations |
|
| 936 | ) |
|
| 937 | ); |
|
| 938 | } |
|
| 939 | ||
| 940 | /** |
|
| 941 | * Test for the loadLocationChildren() method. |
|
| @@ 977-1001 (lines=25) @@ | ||
| 974 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 975 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 976 | */ |
|
| 977 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 978 | { |
|
| 979 | $this->assertEquals(2, count($locations->locations)); |
|
| 980 | $this->assertEquals(5, $locations->totalCount); |
|
| 981 | ||
| 982 | foreach ($locations->locations as $location) { |
|
| 983 | $this->assertInstanceOf( |
|
| 984 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 985 | $location |
|
| 986 | ); |
|
| 987 | } |
|
| 988 | ||
| 989 | $this->assertEquals( |
|
| 990 | array( |
|
| 991 | $this->generateId('location', 14), |
|
| 992 | $this->generateId('location', 44), |
|
| 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 newLocationUpdateStruct() method. |
|