Code Duplication    Length = 20-20 lines in 2 locations

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

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