Code Duplication    Length = 17-17 lines in 10 locations

eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerContentTest.php 10 locations

@@ 1152-1168 (lines=17) @@
1149
        );
1150
    }
1151
1152
    public function testUserMetadataFilterOwnerWrongUserId()
1153
    {
1154
        $this->assertSearchResults(
1155
            [],
1156
            $this->getContentSearchHandler()->findContent(
1157
                new Query(
1158
                    [
1159
                        'filter' => new Criterion\UserMetadata(
1160
                            Criterion\UserMetadata::OWNER,
1161
                            Criterion\Operator::EQ,
1162
                            2
1163
                        ),
1164
                    ]
1165
                )
1166
            )
1167
        );
1168
    }
1169
1170
    public function testUserMetadataFilterOwnerAdministrator()
1171
    {
@@ 1190-1206 (lines=17) @@
1187
        );
1188
    }
1189
1190
    public function testUserMetadataFilterOwnerEqAMember()
1191
    {
1192
        $this->assertSearchResults(
1193
            [223],
1194
            $this->getContentSearchHandler()->findContent(
1195
                new Query(
1196
                    [
1197
                        'filter' => new Criterion\UserMetadata(
1198
                            Criterion\UserMetadata::OWNER,
1199
                            Criterion\Operator::EQ,
1200
                            226
1201
                        ),
1202
                    ]
1203
                )
1204
            )
1205
        );
1206
    }
1207
1208
    public function testUserMetadataFilterOwnerInAMember()
1209
    {
@@ 1208-1224 (lines=17) @@
1205
        );
1206
    }
1207
1208
    public function testUserMetadataFilterOwnerInAMember()
1209
    {
1210
        $this->assertSearchResults(
1211
            [223],
1212
            $this->getContentSearchHandler()->findContent(
1213
                new Query(
1214
                    [
1215
                        'filter' => new Criterion\UserMetadata(
1216
                            Criterion\UserMetadata::OWNER,
1217
                            Criterion\Operator::IN,
1218
                            [226]
1219
                        ),
1220
                    ]
1221
                )
1222
            )
1223
        );
1224
    }
1225
1226
    public function testUserMetadataFilterCreatorEqAMember()
1227
    {
@@ 1226-1242 (lines=17) @@
1223
        );
1224
    }
1225
1226
    public function testUserMetadataFilterCreatorEqAMember()
1227
    {
1228
        $this->assertSearchResults(
1229
            [223],
1230
            $this->getContentSearchHandler()->findContent(
1231
                new Query(
1232
                    [
1233
                        'filter' => new Criterion\UserMetadata(
1234
                            Criterion\UserMetadata::MODIFIER,
1235
                            Criterion\Operator::EQ,
1236
                            226
1237
                        ),
1238
                    ]
1239
                )
1240
            )
1241
        );
1242
    }
1243
1244
    public function testUserMetadataFilterCreatorInAMember()
1245
    {
@@ 1244-1260 (lines=17) @@
1241
        );
1242
    }
1243
1244
    public function testUserMetadataFilterCreatorInAMember()
1245
    {
1246
        $this->assertSearchResults(
1247
            [223],
1248
            $this->getContentSearchHandler()->findContent(
1249
                new Query(
1250
                    [
1251
                        'filter' => new Criterion\UserMetadata(
1252
                            Criterion\UserMetadata::MODIFIER,
1253
                            Criterion\Operator::IN,
1254
                            [226]
1255
                        ),
1256
                    ]
1257
                )
1258
            )
1259
        );
1260
    }
1261
1262
    public function testUserMetadataFilterEqGroupMember()
1263
    {
@@ 1262-1278 (lines=17) @@
1259
        );
1260
    }
1261
1262
    public function testUserMetadataFilterEqGroupMember()
1263
    {
1264
        $this->assertSearchResults(
1265
            [223],
1266
            $this->getContentSearchHandler()->findContent(
1267
                new Query(
1268
                    [
1269
                        'filter' => new Criterion\UserMetadata(
1270
                            Criterion\UserMetadata::GROUP,
1271
                            Criterion\Operator::EQ,
1272
                            11
1273
                        ),
1274
                    ]
1275
                )
1276
            )
1277
        );
1278
    }
1279
1280
    public function testUserMetadataFilterInGroupMember()
1281
    {
@@ 1280-1296 (lines=17) @@
1277
        );
1278
    }
1279
1280
    public function testUserMetadataFilterInGroupMember()
1281
    {
1282
        $this->assertSearchResults(
1283
            [223],
1284
            $this->getContentSearchHandler()->findContent(
1285
                new Query(
1286
                    [
1287
                        'filter' => new Criterion\UserMetadata(
1288
                            Criterion\UserMetadata::GROUP,
1289
                            Criterion\Operator::IN,
1290
                            [11]
1291
                        ),
1292
                    ]
1293
                )
1294
            )
1295
        );
1296
    }
1297
1298
    public function testUserMetadataFilterEqGroupMemberNoMatch()
1299
    {
@@ 1298-1314 (lines=17) @@
1295
        );
1296
    }
1297
1298
    public function testUserMetadataFilterEqGroupMemberNoMatch()
1299
    {
1300
        $this->assertSearchResults(
1301
            [],
1302
            $this->getContentSearchHandler()->findContent(
1303
                new Query(
1304
                    [
1305
                        'filter' => new Criterion\UserMetadata(
1306
                            Criterion\UserMetadata::GROUP,
1307
                            Criterion\Operator::EQ,
1308
                            13
1309
                        ),
1310
                    ]
1311
                )
1312
            )
1313
        );
1314
    }
1315
1316
    public function testUserMetadataFilterInGroupMemberNoMatch()
1317
    {
@@ 1316-1332 (lines=17) @@
1313
        );
1314
    }
1315
1316
    public function testUserMetadataFilterInGroupMemberNoMatch()
1317
    {
1318
        $this->assertSearchResults(
1319
            [],
1320
            $this->getContentSearchHandler()->findContent(
1321
                new Query(
1322
                    [
1323
                        'filter' => new Criterion\UserMetadata(
1324
                            Criterion\UserMetadata::GROUP,
1325
                            Criterion\Operator::IN,
1326
                            [13]
1327
                        ),
1328
                    ]
1329
                )
1330
            )
1331
        );
1332
    }
1333
1334
    public function testFieldRelationFilterContainsSingle()
1335
    {
@@ 1352-1368 (lines=17) @@
1349
        );
1350
    }
1351
1352
    public function testFieldRelationFilterContainsSingleNoMatch()
1353
    {
1354
        $this->assertSearchResults(
1355
            [],
1356
            $this->getContentSearchHandler()->findContent(
1357
                new Query(
1358
                    [
1359
                        'filter' => new Criterion\FieldRelation(
1360
                            'billboard',
1361
                            Criterion\Operator::CONTAINS,
1362
                            [4]
1363
                        ),
1364
                    ]
1365
                )
1366
            )
1367
        );
1368
    }
1369
1370
    public function testFieldRelationFilterContainsArray()
1371
    {