Code Duplication    Length = 20-20 lines in 2 locations

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

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