Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1010-1029 (lines=20) @@
1007
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1008
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1009
     */
1010
    public function testLoadLocationChildrenWithOffset()
1011
    {
1012
        $repository = $this->getRepository();
1013
1014
        $locationId = $this->generateId('location', 5);
1015
        /* BEGIN: Use Case */
1016
        // $locationId is the ID of an existing location
1017
        $locationService = $repository->getLocationService();
1018
1019
        $location = $locationService->loadLocation($locationId);
1020
1021
        $childLocations = $locationService->loadLocationChildren($location, 2);
1022
        /* END: Use Case */
1023
1024
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1025
        $this->assertInternalType('array', $childLocations->locations);
1026
        $this->assertInternalType('int', $childLocations->totalCount);
1027
1028
        return $childLocations;
1029
    }
1030
1031
    /**
1032
     * Test for the loadLocationChildren() method.
@@ 1074-1093 (lines=20) @@
1071
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1072
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1073
     */
1074
    public function testLoadLocationChildrenWithOffsetAndLimit()
1075
    {
1076
        $repository = $this->getRepository();
1077
1078
        $locationId = $this->generateId('location', 5);
1079
        /* BEGIN: Use Case */
1080
        // $locationId is the ID of an existing location
1081
        $locationService = $repository->getLocationService();
1082
1083
        $location = $locationService->loadLocation($locationId);
1084
1085
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1086
        /* END: Use Case */
1087
1088
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1089
        $this->assertInternalType('array', $childLocations->locations);
1090
        $this->assertInternalType('int', $childLocations->totalCount);
1091
1092
        return $childLocations;
1093
    }
1094
1095
    /**
1096
     * Test for the loadLocationChildren() method.