Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 782-801 (lines=20) @@
779
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
780
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
781
     */
782
    public function testLoadLocationChildrenWithOffset()
783
    {
784
        $repository = $this->getRepository();
785
786
        $locationId = $this->generateId('location', 5);
787
        /* BEGIN: Use Case */
788
        // $locationId is the ID of an existing location
789
        $locationService = $repository->getLocationService();
790
791
        $location = $locationService->loadLocation($locationId);
792
793
        $childLocations = $locationService->loadLocationChildren($location, 2);
794
        /* END: Use Case */
795
796
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
797
        $this->assertInternalType('array', $childLocations->locations);
798
        $this->assertInternalType('int', $childLocations->totalCount);
799
800
        return $childLocations;
801
    }
802
803
    /**
804
     * Test for the loadLocationChildren() method.
@@ 846-865 (lines=20) @@
843
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
844
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildren
845
     */
846
    public function testLoadLocationChildrenWithOffsetAndLimit()
847
    {
848
        $repository = $this->getRepository();
849
850
        $locationId = $this->generateId('location', 5);
851
        /* BEGIN: Use Case */
852
        // $locationId is the ID of an existing location
853
        $locationService = $repository->getLocationService();
854
855
        $location = $locationService->loadLocation($locationId);
856
857
        $childLocations = $locationService->loadLocationChildren($location, 2, 2);
858
        /* END: Use Case */
859
860
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationList', $childLocations);
861
        $this->assertInternalType('array', $childLocations->locations);
862
        $this->assertInternalType('int', $childLocations->totalCount);
863
864
        return $childLocations;
865
    }
866
867
    /**
868
     * Test for the loadLocationChildren() method.