Code Duplication    Length = 25-26 lines in 2 locations

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

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