Code Duplication    Length = 25-26 lines in 2 locations

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

@@ 1088-1113 (lines=26) @@
1085
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset)
1086
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffset
1087
     */
1088
    public function testLoadLocationChildrenDataWithOffset(LocationList $locations)
1089
    {
1090
        $this->assertCount(3, $locations->locations);
1091
        $this->assertEquals(5, $locations->totalCount);
1092
1093
        foreach ($locations->locations as $location) {
1094
            $this->assertInstanceOf(
1095
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1096
                $location
1097
            );
1098
        }
1099
1100
        $this->assertEquals(
1101
            [
1102
                $this->generateId('location', 14),
1103
                $this->generateId('location', 44),
1104
                $this->generateId('location', 61),
1105
            ],
1106
            array_map(
1107
                function (Location $location) {
1108
                    return $location->id;
1109
                },
1110
                $locations->locations
1111
            )
1112
        );
1113
    }
1114
1115
    /**
1116
     * Test for the loadLocationChildren() method.
@@ 1152-1176 (lines=25) @@
1149
     * @see \eZ\Publish\API\Repository\LocationService::loadLocationChildren($location, $offset, $limit)
1150
     * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocationChildrenWithOffsetAndLimit
1151
     */
1152
    public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations)
1153
    {
1154
        $this->assertCount(2, $locations->locations);
1155
        $this->assertEquals(5, $locations->totalCount);
1156
1157
        foreach ($locations->locations as $location) {
1158
            $this->assertInstanceOf(
1159
                '\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
1160
                $location
1161
            );
1162
        }
1163
1164
        $this->assertEquals(
1165
            [
1166
                $this->generateId('location', 14),
1167
                $this->generateId('location', 44),
1168
            ],
1169
            array_map(
1170
                function (Location $location) {
1171
                    return $location->id;
1172
                },
1173
                $locations->locations
1174
            )
1175
        );
1176
    }
1177
1178
    /**
1179
     * Test for the newLocationUpdateStruct() method.