Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1078-1097 (lines=20) @@
1075
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1076
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1077
     */
1078
    public function testLoadLocationChildrenWithOffset()
1079
    {
1080
        $repository = $this->getRepository();
1081
1082
        $locationId = $this->generateId('location', 5);
1083
        /* BEGIN: Use Case */
1084
        // $locationId is the ID of an existing location
1085
        $locationService = $repository->getLocationService();
1086
1087
        $location = $locationService->loadLocation($locationId);
1088
1089
        $childLocations = $locationService->loadLocationChildren($location, 2);
1090
        /* END: Use Case */
1091
1092
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1093
        $this->assertInternalType('array', $childLocations->locations);
1094
        $this->assertInternalType('int', $childLocations->totalCount);
1095
1096
        return $childLocations;
1097
    }
1098
1099
    /**
1100
     * Test for the loadLocationChildren() method.
@@ 1142-1161 (lines=20) @@
1139
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1140
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1141
     */
1142
    public function testLoadLocationChildrenWithOffsetAndLimit()
1143
    {
1144
        $repository = $this->getRepository();
1145
1146
        $locationId = $this->generateId('location', 5);
1147
        /* BEGIN: Use Case */
1148
        // $locationId is the ID of an existing location
1149
        $locationService = $repository->getLocationService();
1150
1151
        $location = $locationService->loadLocation($locationId);
1152
1153
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1154
        /* END: Use Case */
1155
1156
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1157
        $this->assertInternalType('array', $childLocations->locations);
1158
        $this->assertInternalType('int', $childLocations->totalCount);
1159
1160
        return $childLocations;
1161
    }
1162
1163
    /**
1164
     * Test for the loadLocationChildren() method.