Code Duplication    Length = 20-20 lines in 2 locations

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

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