Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 800-825 (lines=26) @@
797
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
798
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
799
     */
800
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
801
    {
802
        $this->assertEquals(3, count($locations->locations));
803
        $this->assertEquals(5, $locations->totalCount);
804
805
        foreach ($locations->locations as $location) {
806
            $this->assertInstanceOf(
807
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
808
                $location
809
            );
810
        }
811
812
        $this->assertEquals(
813
            [
814
                $this->generateId('location', 14),
815
                $this->generateId('location', 44),
816
                $this->generateId('location', 61),
817
            ],
818
            array_map(
819
                function (Location $location) {
820
                    return $location->id;
821
                },
822
                $locations->locations
823
            )
824
        );
825
    }
826
827
    /**
828
     * Test for the loadLocationChildren() method.
@@ 864-888 (lines=25) @@
861
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
862
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
863
     */
864
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
865
    {
866
        $this->assertEquals(2, count($locations->locations));
867
        $this->assertEquals(5, $locations->totalCount);
868
869
        foreach ($locations->locations as $location) {
870
            $this->assertInstanceOf(
871
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
872
                $location
873
            );
874
        }
875
876
        $this->assertEquals(
877
            [
878
                $this->generateId('location', 14),
879
                $this->generateId('location', 44),
880
            ],
881
            array_map(
882
                function (Location $location) {
883
                    return $location->id;
884
                },
885
                $locations->locations
886
            )
887
        );
888
    }
889
890
    /**
891
     * Test for the newLocationUpdateStruct() method.