| @@ 870-895 (lines=26) @@ | ||
| 867 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 868 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 869 | */ |
|
| 870 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 871 | { |
|
| 872 | $this->assertEquals(3, count($locations->locations)); |
|
| 873 | $this->assertEquals(5, $locations->totalCount); |
|
| 874 | ||
| 875 | foreach ($locations->locations as $location) { |
|
| 876 | $this->assertInstanceOf( |
|
| 877 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 878 | $location |
|
| 879 | ); |
|
| 880 | } |
|
| 881 | ||
| 882 | $this->assertEquals( |
|
| 883 | array( |
|
| 884 | $this->generateId('location', 14), |
|
| 885 | $this->generateId('location', 44), |
|
| 886 | $this->generateId('location', 61), |
|
| 887 | ), |
|
| 888 | array_map( |
|
| 889 | function (Location $location) { |
|
| 890 | return $location->id; |
|
| 891 | }, |
|
| 892 | $locations->locations |
|
| 893 | ) |
|
| 894 | ); |
|
| 895 | } |
|
| 896 | ||
| 897 | /** |
|
| 898 | * Test for the loadLocationChildren() method. |
|
| @@ 934-958 (lines=25) @@ | ||
| 931 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 932 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 933 | */ |
|
| 934 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 935 | { |
|
| 936 | $this->assertEquals(2, count($locations->locations)); |
|
| 937 | $this->assertEquals(5, $locations->totalCount); |
|
| 938 | ||
| 939 | foreach ($locations->locations as $location) { |
|
| 940 | $this->assertInstanceOf( |
|
| 941 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 942 | $location |
|
| 943 | ); |
|
| 944 | } |
|
| 945 | ||
| 946 | $this->assertEquals( |
|
| 947 | array( |
|
| 948 | $this->generateId('location', 14), |
|
| 949 | $this->generateId('location', 44), |
|
| 950 | ), |
|
| 951 | array_map( |
|
| 952 | function (Location $location) { |
|
| 953 | return $location->id; |
|
| 954 | }, |
|
| 955 | $locations->locations |
|
| 956 | ) |
|
| 957 | ); |
|
| 958 | } |
|
| 959 | ||
| 960 | /** |
|
| 961 | * Test for the newLocationUpdateStruct() method. |
|