Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1114-1133 (lines=20) @@
1111
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1112
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1113
     */
1114
    public function testLoadLocationChildrenWithOffset()
1115
    {
1116
        $repository = $this->getRepository();
1117
1118
        $locationId = $this->generateId('location', 5);
1119
        /* BEGIN: Use Case */
1120
        // $locationId is the ID of an existing location
1121
        $locationService = $repository->getLocationService();
1122
1123
        $location = $locationService->loadLocation($locationId);
1124
1125
        $childLocations = $locationService->loadLocationChildren($location, 2);
1126
        /* END: Use Case */
1127
1128
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1129
        $this->assertInternalType('array', $childLocations->locations);
1130
        $this->assertInternalType('int', $childLocations->totalCount);
1131
1132
        return $childLocations;
1133
    }
1134
1135
    /**
1136
     * Test for the loadLocationChildren() method.
@@ 1178-1197 (lines=20) @@
1175
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1176
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1177
     */
1178
    public function testLoadLocationChildrenWithOffsetAndLimit()
1179
    {
1180
        $repository = $this->getRepository();
1181
1182
        $locationId = $this->generateId('location', 5);
1183
        /* BEGIN: Use Case */
1184
        // $locationId is the ID of an existing location
1185
        $locationService = $repository->getLocationService();
1186
1187
        $location = $locationService->loadLocation($locationId);
1188
1189
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1190
        /* END: Use Case */
1191
1192
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1193
        $this->assertInternalType('array', $childLocations->locations);
1194
        $this->assertInternalType('int', $childLocations->totalCount);
1195
1196
        return $childLocations;
1197
    }
1198
1199
    /**
1200
     * Test for the loadLocationChildren() method.