Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 843-862 (lines=20) @@
840
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
841
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
842
     */
843
    public function testLoadLocationChildrenWithOffset()
844
    {
845
        $repository = $this->getRepository();
846
847
        $locationId = $this->generateId('location', 5);
848
        /* BEGIN: Use Case */
849
        // $locationId is the ID of an existing location
850
        $locationService = $repository->getLocationService();
851
852
        $location = $locationService->loadLocation($locationId);
853
854
        $childLocations = $locationService->loadLocationChildren($location, 2);
855
        /* END: Use Case */
856
857
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
858
        $this->assertInternalType('array', $childLocations->locations);
859
        $this->assertInternalType('int', $childLocations->totalCount);
860
861
        return $childLocations;
862
    }
863
864
    /**
865
     * Test for the loadLocationChildren() method.
@@ 907-926 (lines=20) @@
904
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
905
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
906
     */
907
    public function testLoadLocationChildrenWithOffsetAndLimit()
908
    {
909
        $repository = $this->getRepository();
910
911
        $locationId = $this->generateId('location', 5);
912
        /* BEGIN: Use Case */
913
        // $locationId is the ID of an existing location
914
        $locationService = $repository->getLocationService();
915
916
        $location = $locationService->loadLocation($locationId);
917
918
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
919
        /* END: Use Case */
920
921
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
922
        $this->assertInternalType('array', $childLocations->locations);
923
        $this->assertInternalType('int', $childLocations->totalCount);
924
925
        return $childLocations;
926
    }
927
928
    /**
929
     * Test for the loadLocationChildren() method.