Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 1137-1162 (lines=26) @@
1134
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1135
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
1136
     */
1137
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
1138
    {
1139
        $this->assertEquals(3, count($locations->locations));
1140
        $this->assertEquals(5, $locations->totalCount);
1141
1142
        foreach ($locations->locations as $location) {
1143
            $this->assertInstanceOf(
1144
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1145
                $location
1146
            );
1147
        }
1148
1149
        $this->assertEquals(
1150
            [
1151
                $this->generateId('location', 14),
1152
                $this->generateId('location', 44),
1153
                $this->generateId('location', 61),
1154
            ],
1155
            array_map(
1156
                function (Location $location) {
1157
                    return $location->id;
1158
                },
1159
                $locations->locations
1160
            )
1161
        );
1162
    }
1163
1164
    /**
1165
     * Test for the loadLocationChildren() method.
@@ 1201-1225 (lines=25) @@
1198
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1199
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1200
     */
1201
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1202
    {
1203
        $this->assertEquals(2, count($locations->locations));
1204
        $this->assertEquals(5, $locations->totalCount);
1205
1206
        foreach ($locations->locations as $location) {
1207
            $this->assertInstanceOf(
1208
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1209
                $location
1210
            );
1211
        }
1212
1213
        $this->assertEquals(
1214
            [
1215
                $this->generateId('location', 14),
1216
                $this->generateId('location', 44),
1217
            ],
1218
            array_map(
1219
                function (Location $location) {
1220
                    return $location->id;
1221
                },
1222
                $locations->locations
1223
            )
1224
        );
1225
    }
1226
1227
    /**
1228
     * Test for the newLocationUpdateStruct() method.