Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 884-903 (lines=20) @@
881
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
882
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
883
     */
884
    public function testLoadLocationChildrenWithOffset()
885
    {
886
        $repository = $this->getRepository();
887
888
        $locationId = $this->generateId('location', 5);
889
        /* BEGIN: Use Case */
890
        // $locationId is the ID of an existing location
891
        $locationService = $repository->getLocationService();
892
893
        $location = $locationService->loadLocation($locationId);
894
895
        $childLocations = $locationService->loadLocationChildren($location, 2);
896
        /* END: Use Case */
897
898
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
899
        $this->assertInternalType('array', $childLocations->locations);
900
        $this->assertInternalType('int', $childLocations->totalCount);
901
902
        return $childLocations;
903
    }
904
905
    /**
906
     * Test for the loadLocationChildren() method.
@@ 948-967 (lines=20) @@
945
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
946
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
947
     */
948
    public function testLoadLocationChildrenWithOffsetAndLimit()
949
    {
950
        $repository = $this->getRepository();
951
952
        $locationId = $this->generateId('location', 5);
953
        /* BEGIN: Use Case */
954
        // $locationId is the ID of an existing location
955
        $locationService = $repository->getLocationService();
956
957
        $location = $locationService->loadLocation($locationId);
958
959
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
960
        /* END: Use Case */
961
962
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
963
        $this->assertInternalType('array', $childLocations->locations);
964
        $this->assertInternalType('int', $childLocations->totalCount);
965
966
        return $childLocations;
967
    }
968
969
    /**
970
     * Test for the loadLocationChildren() method.