Code Duplication    Length = 20-20 lines in 2 locations

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

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