| @@ 811-836 (lines=26) @@ | ||
| 808 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 809 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 810 | */ |
|
| 811 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 812 | { |
|
| 813 | $this->assertEquals(3, count($locations->locations)); |
|
| 814 | $this->assertEquals(5, $locations->totalCount); |
|
| 815 | ||
| 816 | foreach ($locations->locations as $location) { |
|
| 817 | $this->assertInstanceOf( |
|
| 818 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 819 | $location |
|
| 820 | ); |
|
| 821 | } |
|
| 822 | ||
| 823 | $this->assertEquals( |
|
| 824 | array( |
|
| 825 | $this->generateId('location', 14), |
|
| 826 | $this->generateId('location', 44), |
|
| 827 | $this->generateId('location', 61), |
|
| 828 | ), |
|
| 829 | array_map( |
|
| 830 | function (Location $location) { |
|
| 831 | return $location->id; |
|
| 832 | }, |
|
| 833 | $locations->locations |
|
| 834 | ) |
|
| 835 | ); |
|
| 836 | } |
|
| 837 | ||
| 838 | /** |
|
| 839 | * Test for the loadLocationChildren() method. |
|
| @@ 875-899 (lines=25) @@ | ||
| 872 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 873 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 874 | */ |
|
| 875 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 876 | { |
|
| 877 | $this->assertEquals(2, count($locations->locations)); |
|
| 878 | $this->assertEquals(5, $locations->totalCount); |
|
| 879 | ||
| 880 | foreach ($locations->locations as $location) { |
|
| 881 | $this->assertInstanceOf( |
|
| 882 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 883 | $location |
|
| 884 | ); |
|
| 885 | } |
|
| 886 | ||
| 887 | $this->assertEquals( |
|
| 888 | array( |
|
| 889 | $this->generateId('location', 14), |
|
| 890 | $this->generateId('location', 44), |
|
| 891 | ), |
|
| 892 | array_map( |
|
| 893 | function (Location $location) { |
|
| 894 | return $location->id; |
|
| 895 | }, |
|
| 896 | $locations->locations |
|
| 897 | ) |
|
| 898 | ); |
|
| 899 | } |
|
| 900 | ||
| 901 | /** |
|
| 902 | * Test for the newLocationUpdateStruct() method. |
|