Code Duplication    Length = 20-20 lines in 2 locations

eZ/Publish/API/Repository/Tests/LocationServiceTest.php 2 locations

@@ 945-964 (lines=20) @@
942
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
943
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
944
     */
945
    public function testLoadLocationChildrenWithOffset()
946
    {
947
        $repository = $this->getRepository();
948
949
        $locationId = $this->generateId('location', 5);
950
        /* BEGIN: Use Case */
951
        // $locationId is the ID of an existing location
952
        $locationService = $repository->getLocationService();
953
954
        $location = $locationService->loadLocation($locationId);
955
956
        $childLocations = $locationService->loadLocationChildren($location, 2);
957
        /* END: Use Case */
958
959
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
960
        $this->assertInternalType('array', $childLocations->locations);
961
        $this->assertInternalType('int', $childLocations->totalCount);
962
963
        return $childLocations;
964
    }
965
966
    /**
967
     * Test for the loadLocationChildren() method.
@@ 1009-1028 (lines=20) @@
1006
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1007
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1008
     */
1009
    public function testLoadLocationChildrenWithOffsetAndLimit()
1010
    {
1011
        $repository = $this->getRepository();
1012
1013
        $locationId = $this->generateId('location', 5);
1014
        /* BEGIN: Use Case */
1015
        // $locationId is the ID of an existing location
1016
        $locationService = $repository->getLocationService();
1017
1018
        $location = $locationService->loadLocation($locationId);
1019
1020
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1021
        /* END: Use Case */
1022
1023
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1024
        $this->assertInternalType('array', $childLocations->locations);
1025
        $this->assertInternalType('int', $childLocations->totalCount);
1026
1027
        return $childLocations;
1028
    }
1029
1030
    /**
1031
     * Test for the loadLocationChildren() method.