| @@ 799-824 (lines=26) @@ | ||
| 796 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset) |
|
| 797 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset |
|
| 798 | */ |
|
| 799 | public function testLoadLocationChildrenDataWithOffset(LocationList $locations) |
|
| 800 | { |
|
| 801 | $this->assertEquals(3, count($locations->locations)); |
|
| 802 | $this->assertEquals(5, $locations->totalCount); |
|
| 803 | ||
| 804 | foreach ($locations->locations as $location) { |
|
| 805 | $this->assertInstanceOf( |
|
| 806 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 807 | $location |
|
| 808 | ); |
|
| 809 | } |
|
| 810 | ||
| 811 | $this->assertEquals( |
|
| 812 | array( |
|
| 813 | $this->generateId('location', 14), |
|
| 814 | $this->generateId('location', 44), |
|
| 815 | $this->generateId('location', 61), |
|
| 816 | ), |
|
| 817 | array_map( |
|
| 818 | function (Location $location) { |
|
| 819 | return $location->id; |
|
| 820 | }, |
|
| 821 | $locations->locations |
|
| 822 | ) |
|
| 823 | ); |
|
| 824 | } |
|
| 825 | ||
| 826 | /** |
|
| 827 | * Test for the loadLocationChildren() method. |
|
| @@ 863-887 (lines=25) @@ | ||
| 860 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit) |
|
| 861 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit |
|
| 862 | */ |
|
| 863 | public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations) |
|
| 864 | { |
|
| 865 | $this->assertEquals(2, count($locations->locations)); |
|
| 866 | $this->assertEquals(5, $locations->totalCount); |
|
| 867 | ||
| 868 | foreach ($locations->locations as $location) { |
|
| 869 | $this->assertInstanceOf( |
|
| 870 | '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', |
|
| 871 | $location |
|
| 872 | ); |
|
| 873 | } |
|
| 874 | ||
| 875 | $this->assertEquals( |
|
| 876 | array( |
|
| 877 | $this->generateId('location', 14), |
|
| 878 | $this->generateId('location', 44), |
|
| 879 | ), |
|
| 880 | array_map( |
|
| 881 | function (Location $location) { |
|
| 882 | return $location->id; |
|
| 883 | }, |
|
| 884 | $locations->locations |
|
| 885 | ) |
|
| 886 | ); |
|
| 887 | } |
|
| 888 | ||
| 889 | /** |
|
| 890 | * Test for the newLocationUpdateStruct() method. |
|