Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 1080-1105 (lines=26) @@
1077
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1078
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
1079
     */
1080
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
1081
    {
1082
        $this->assertEquals(3, count($locations->locations));
1083
        $this->assertEquals(5, $locations->totalCount);
1084
1085
        foreach ($locations->locations as $location) {
1086
            $this->assertInstanceOf(
1087
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1088
                $location
1089
            );
1090
        }
1091
1092
        $this->assertEquals(
1093
            [
1094
                $this->generateId('location', 14),
1095
                $this->generateId('location', 44),
1096
                $this->generateId('location', 61),
1097
            ],
1098
            array_map(
1099
                function (Location $location) {
1100
                    return $location->id;
1101
                },
1102
                $locations->locations
1103
            )
1104
        );
1105
    }
1106
1107
    /**
1108
     * Test for the loadLocationChildren() method.
@@ 1144-1168 (lines=25) @@
1141
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1142
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1143
     */
1144
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1145
    {
1146
        $this->assertEquals(2, count($locations->locations));
1147
        $this->assertEquals(5, $locations->totalCount);
1148
1149
        foreach ($locations->locations as $location) {
1150
            $this->assertInstanceOf(
1151
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1152
                $location
1153
            );
1154
        }
1155
1156
        $this->assertEquals(
1157
            [
1158
                $this->generateId('location', 14),
1159
                $this->generateId('location', 44),
1160
            ],
1161
            array_map(
1162
                function (Location $location) {
1163
                    return $location->id;
1164
                },
1165
                $locations->locations
1166
            )
1167
        );
1168
    }
1169
1170
    /**
1171
     * Test for the newLocationUpdateStruct() method.