Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 1113-1138 (lines=26) @@
1110
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1111
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
1112
     */
1113
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
1114
    {
1115
        $this->assertCount(3, $locations->locations);
1116
        $this->assertEquals(5, $locations->totalCount);
1117
1118
        foreach ($locations->locations as $location) {
1119
            $this->assertInstanceOf(
1120
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1121
                $location
1122
            );
1123
        }
1124
1125
        $this->assertEquals(
1126
            [
1127
                $this->generateId('location', 14),
1128
                $this->generateId('location', 44),
1129
                $this->generateId('location', 61),
1130
            ],
1131
            array_map(
1132
                function (Location $location) {
1133
                    return $location->id;
1134
                },
1135
                $locations->locations
1136
            )
1137
        );
1138
    }
1139
1140
    /**
1141
     * Test for the loadLocationChildren() method.
@@ 1177-1201 (lines=25) @@
1174
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1175
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1176
     */
1177
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1178
    {
1179
        $this->assertCount(2, $locations->locations);
1180
        $this->assertEquals(5, $locations->totalCount);
1181
1182
        foreach ($locations->locations as $location) {
1183
            $this->assertInstanceOf(
1184
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1185
                $location
1186
            );
1187
        }
1188
1189
        $this->assertEquals(
1190
            [
1191
                $this->generateId('location', 14),
1192
                $this->generateId('location', 44),
1193
            ],
1194
            array_map(
1195
                function (Location $location) {
1196
                    return $location->id;
1197
                },
1198
                $locations->locations
1199
            )
1200
        );
1201
    }
1202
1203
    /**
1204
     * Test for the newLocationUpdateStruct() method.