Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1030-1049 (lines=20) @@
1027
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1028
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1029
     */
1030
    public function testLoadLocationChildrenWithOffset()
1031
    {
1032
        $repository = $this->getRepository();
1033
1034
        $locationId = $this->generateId('location', 5);
1035
        /* BEGIN: Use Case */
1036
        // $locationId is the ID of an existing location
1037
        $locationService = $repository->getLocationService();
1038
1039
        $location = $locationService->loadLocation($locationId);
1040
1041
        $childLocations = $locationService->loadLocationChildren($location, 2);
1042
        /* END: Use Case */
1043
1044
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1045
        $this->assertInternalType('array', $childLocations->locations);
1046
        $this->assertInternalType('int', $childLocations->totalCount);
1047
1048
        return $childLocations;
1049
    }
1050
1051
    /**
1052
     * Test for the loadLocationChildren() method.
@@ 1094-1113 (lines=20) @@
1091
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1092
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1093
     */
1094
    public function testLoadLocationChildrenWithOffsetAndLimit()
1095
    {
1096
        $repository = $this->getRepository();
1097
1098
        $locationId = $this->generateId('location', 5);
1099
        /* BEGIN: Use Case */
1100
        // $locationId is the ID of an existing location
1101
        $locationService = $repository->getLocationService();
1102
1103
        $location = $locationService->loadLocation($locationId);
1104
1105
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1106
        /* END: Use Case */
1107
1108
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1109
        $this->assertInternalType('array', $childLocations->locations);
1110
        $this->assertInternalType('int', $childLocations->totalCount);
1111
1112
        return $childLocations;
1113
    }
1114
1115
    /**
1116
     * Test for the loadLocationChildren() method.