Code Duplication    Length = 20-20 lines in 2 locations

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

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