Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 931-950 (lines=20) @@
928
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
929
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
930
     */
931
    public function testLoadLocationChildrenWithOffset()
932
    {
933
        $repository = $this->getRepository();
934
935
        $locationId = $this->generateId('location', 5);
936
        /* BEGIN: Use Case */
937
        // $locationId is the ID of an existing location
938
        $locationService = $repository->getLocationService();
939
940
        $location = $locationService->loadLocation($locationId);
941
942
        $childLocations = $locationService->loadLocationChildren($location, 2);
943
        /* END: Use Case */
944
945
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
946
        $this->assertInternalType('array', $childLocations->locations);
947
        $this->assertInternalType('int', $childLocations->totalCount);
948
949
        return $childLocations;
950
    }
951
952
    /**
953
     * Test for the loadLocationChildren() method.
@@ 995-1014 (lines=20) @@
992
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
993
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
994
     */
995
    public function testLoadLocationChildrenWithOffsetAndLimit()
996
    {
997
        $repository = $this->getRepository();
998
999
        $locationId = $this->generateId('location', 5);
1000
        /* BEGIN: Use Case */
1001
        // $locationId is the ID of an existing location
1002
        $locationService = $repository->getLocationService();
1003
1004
        $location = $locationService->loadLocation($locationId);
1005
1006
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
1007
        /* END: Use Case */
1008
1009
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
1010
        $this->assertInternalType('array', $childLocations->locations);
1011
        $this->assertInternalType('int', $childLocations->totalCount);
1012
1013
        return $childLocations;
1014
    }
1015
1016
    /**
1017
     * Test for the loadLocationChildren() method.