Code Duplication    Length = 17-17 lines in 10 locations

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

@@ 1234-1250 (lines=17) @@
1231
        );
1232
    }
1233
1234
    public function testUserMetadataFilterOwnerWrongUserId()
1235
    {
1236
        $this->assertSearchResults(
1237
            array(),
1238
            $this->getContentSearchHandler()->findContent(
1239
                new Query(
1240
                    array(
1241
                        'filter' => new Criterion\UserMetadata(
1242
                            Criterion\UserMetadata::OWNER,
1243
                            Criterion\Operator::EQ,
1244
                            2
1245
                        ),
1246
                    )
1247
                )
1248
            )
1249
        );
1250
    }
1251
1252
    public function testUserMetadataFilterOwnerAdministrator()
1253
    {
@@ 1272-1288 (lines=17) @@
1269
        );
1270
    }
1271
1272
    public function testUserMetadataFilterOwnerEqAMember()
1273
    {
1274
        $this->assertSearchResults(
1275
            array(223),
1276
            $this->getContentSearchHandler()->findContent(
1277
                new Query(
1278
                    array(
1279
                        'filter' => new Criterion\UserMetadata(
1280
                            Criterion\UserMetadata::OWNER,
1281
                            Criterion\Operator::EQ,
1282
                            226
1283
                        ),
1284
                    )
1285
                )
1286
            )
1287
        );
1288
    }
1289
1290
    public function testUserMetadataFilterOwnerInAMember()
1291
    {
@@ 1290-1306 (lines=17) @@
1287
        );
1288
    }
1289
1290
    public function testUserMetadataFilterOwnerInAMember()
1291
    {
1292
        $this->assertSearchResults(
1293
            array(223),
1294
            $this->getContentSearchHandler()->findContent(
1295
                new Query(
1296
                    array(
1297
                        'filter' => new Criterion\UserMetadata(
1298
                            Criterion\UserMetadata::OWNER,
1299
                            Criterion\Operator::IN,
1300
                            array(226)
1301
                        ),
1302
                    )
1303
                )
1304
            )
1305
        );
1306
    }
1307
1308
    public function testUserMetadataFilterCreatorEqAMember()
1309
    {
@@ 1308-1324 (lines=17) @@
1305
        );
1306
    }
1307
1308
    public function testUserMetadataFilterCreatorEqAMember()
1309
    {
1310
        $this->assertSearchResults(
1311
            array(223),
1312
            $this->getContentSearchHandler()->findContent(
1313
                new Query(
1314
                    array(
1315
                        'filter' => new Criterion\UserMetadata(
1316
                            Criterion\UserMetadata::MODIFIER,
1317
                            Criterion\Operator::EQ,
1318
                            226
1319
                        ),
1320
                    )
1321
                )
1322
            )
1323
        );
1324
    }
1325
1326
    public function testUserMetadataFilterCreatorInAMember()
1327
    {
@@ 1326-1342 (lines=17) @@
1323
        );
1324
    }
1325
1326
    public function testUserMetadataFilterCreatorInAMember()
1327
    {
1328
        $this->assertSearchResults(
1329
            array(223),
1330
            $this->getContentSearchHandler()->findContent(
1331
                new Query(
1332
                    array(
1333
                        'filter' => new Criterion\UserMetadata(
1334
                            Criterion\UserMetadata::MODIFIER,
1335
                            Criterion\Operator::IN,
1336
                            array(226)
1337
                        ),
1338
                    )
1339
                )
1340
            )
1341
        );
1342
    }
1343
1344
    public function testUserMetadataFilterEqGroupMember()
1345
    {
@@ 1344-1360 (lines=17) @@
1341
        );
1342
    }
1343
1344
    public function testUserMetadataFilterEqGroupMember()
1345
    {
1346
        $this->assertSearchResults(
1347
            array(223),
1348
            $this->getContentSearchHandler()->findContent(
1349
                new Query(
1350
                    array(
1351
                        'filter' => new Criterion\UserMetadata(
1352
                            Criterion\UserMetadata::GROUP,
1353
                            Criterion\Operator::EQ,
1354
                            11
1355
                        ),
1356
                    )
1357
                )
1358
            )
1359
        );
1360
    }
1361
1362
    public function testUserMetadataFilterInGroupMember()
1363
    {
@@ 1362-1378 (lines=17) @@
1359
        );
1360
    }
1361
1362
    public function testUserMetadataFilterInGroupMember()
1363
    {
1364
        $this->assertSearchResults(
1365
            array(223),
1366
            $this->getContentSearchHandler()->findContent(
1367
                new Query(
1368
                    array(
1369
                        'filter' => new Criterion\UserMetadata(
1370
                            Criterion\UserMetadata::GROUP,
1371
                            Criterion\Operator::IN,
1372
                            array(11)
1373
                        ),
1374
                    )
1375
                )
1376
            )
1377
        );
1378
    }
1379
1380
    public function testUserMetadataFilterEqGroupMemberNoMatch()
1381
    {
@@ 1380-1396 (lines=17) @@
1377
        );
1378
    }
1379
1380
    public function testUserMetadataFilterEqGroupMemberNoMatch()
1381
    {
1382
        $this->assertSearchResults(
1383
            array(),
1384
            $this->getContentSearchHandler()->findContent(
1385
                new Query(
1386
                    array(
1387
                        'filter' => new Criterion\UserMetadata(
1388
                            Criterion\UserMetadata::GROUP,
1389
                            Criterion\Operator::EQ,
1390
                            13
1391
                        ),
1392
                    )
1393
                )
1394
            )
1395
        );
1396
    }
1397
1398
    public function testUserMetadataFilterInGroupMemberNoMatch()
1399
    {
@@ 1398-1414 (lines=17) @@
1395
        );
1396
    }
1397
1398
    public function testUserMetadataFilterInGroupMemberNoMatch()
1399
    {
1400
        $this->assertSearchResults(
1401
            array(),
1402
            $this->getContentSearchHandler()->findContent(
1403
                new Query(
1404
                    array(
1405
                        'filter' => new Criterion\UserMetadata(
1406
                            Criterion\UserMetadata::GROUP,
1407
                            Criterion\Operator::IN,
1408
                            array(13)
1409
                        ),
1410
                    )
1411
                )
1412
            )
1413
        );
1414
    }
1415
1416
    public function testFieldRelationFilterContainsSingle()
1417
    {
@@ 1434-1450 (lines=17) @@
1431
        );
1432
    }
1433
1434
    public function testFieldRelationFilterContainsSingleNoMatch()
1435
    {
1436
        $this->assertSearchResults(
1437
            array(),
1438
            $this->getContentSearchHandler()->findContent(
1439
                new Query(
1440
                    array(
1441
                        'filter' => new Criterion\FieldRelation(
1442
                            'billboard',
1443
                            Criterion\Operator::CONTAINS,
1444
                            array(4)
1445
                        ),
1446
                    )
1447
                )
1448
            )
1449
        );
1450
    }
1451
1452
    public function testFieldRelationFilterContainsArray()
1453
    {