Code Duplication    Length = 20-20 lines in 2 locations

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

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