Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 1051-1070 (lines=20) @@
1048
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1049
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1050
     */
1051
    public function testLoadLocationChildrenWithOffset()
1052
    {
1053
        $repository = $this->getRepository();
1054
1055
        $locationId = $this->generateId('location', 5);
1056
        /* BEGIN: Use Case */
1057
        // $locationId is the ID of an existing location
1058
        $locationService = $repository->getLocationService();
1059
1060
        $location = $locationService->loadLocation($locationId);
1061
1062
        $childLocations = $locationService->loadLocationChildren($location, 2);
1063
        /* END: Use Case */
1064
1065
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1066
        $this->assertInternalType('array', $childLocations->locations);
1067
        $this->assertInternalType('int', $childLocations->totalCount);
1068
1069
        return $childLocations;
1070
    }
1071
1072
    /**
1073
     * Test for the loadLocationChildren() method.
@@ 1115-1134 (lines=20) @@
1112
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1113
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
1114
     */
1115
    public function testLoadLocationChildrenWithOffsetAndLimit()
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, 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.