Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 872-897 (lines=26) @@
869
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
870
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
871
     */
872
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
873
    {
874
        $this->assertEquals(3, count($locations->locations));
875
        $this->assertEquals(5, $locations->totalCount);
876
877
        foreach ($locations->locations as $location) {
878
            $this->assertInstanceOf(
879
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
880
                $location
881
            );
882
        }
883
884
        $this->assertEquals(
885
            array(
886
                $this->generateId('location', 14),
887
                $this->generateId('location', 44),
888
                $this->generateId('location', 61),
889
            ),
890
            array_map(
891
                function (Location $location) {
892
                    return $location->id;
893
                },
894
                $locations->locations
895
            )
896
        );
897
    }
898
899
    /**
900
     * Test for the loadLocationChildren() method.
@@ 936-960 (lines=25) @@
933
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
934
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
935
     */
936
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
937
    {
938
        $this->assertEquals(2, count($locations->locations));
939
        $this->assertEquals(5, $locations->totalCount);
940
941
        foreach ($locations->locations as $location) {
942
            $this->assertInstanceOf(
943
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
944
                $location
945
            );
946
        }
947
948
        $this->assertEquals(
949
            array(
950
                $this->generateId('location', 14),
951
                $this->generateId('location', 44),
952
            ),
953
            array_map(
954
                function (Location $location) {
955
                    return $location->id;
956
                },
957
                $locations->locations
958
            )
959
        );
960
    }
961
962
    /**
963
     * Test for the newLocationUpdateStruct() method.