Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1008-1027 (lines=20) @@
1005
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1006
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1007
     */
1008
    public function testLoadLocationChildrenWithOffset()
1009
    {
1010
        $repository = $this->getRepository();
1011
1012
        $locationId = $this->generateId('location', 5);
1013
        /* BEGIN: Use Case */
1014
        // $locationId is the ID of an existing location
1015
        $locationService = $repository->getLocationService();
1016
1017
        $location = $locationService->loadLocation($locationId);
1018
1019
        $childLocations = $locationService->loadLocationChildren($location, 2);
1020
        /* END: Use Case */
1021
1022
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1023
        $this->assertInternalType('array', $childLocations->locations);
1024
        $this->assertInternalType('int', $childLocations->totalCount);
1025
1026
        return $childLocations;
1027
    }
1028
1029
    /**
1030
     * Test for the loadLocationChildren() method.
@@ 1072-1091 (lines=20) @@
1069
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1070
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1071
     */
1072
    public function testLoadLocationChildrenWithOffsetAndLimit()
1073
    {
1074
        $repository = $this->getRepository();
1075
1076
        $locationId = $this->generateId('location', 5);
1077
        /* BEGIN: Use Case */
1078
        // $locationId is the ID of an existing location
1079
        $locationService = $repository->getLocationService();
1080
1081
        $location = $locationService->loadLocation($locationId);
1082
1083
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1084
        /* END: Use Case */
1085
1086
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1087
        $this->assertInternalType('array', $childLocations->locations);
1088
        $this->assertInternalType('int', $childLocations->totalCount);
1089
1090
        return $childLocations;
1091
    }
1092
1093
    /**
1094
     * Test for the loadLocationChildren() method.