Code Duplication    Length = 17-21 lines in 4 locations

eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationTest.php 4 locations

@@ 1292-1308 (lines=17) @@
1289
        );
1290
    }
1291
1292
    public function testFieldRelationFilterContainsArray()
1293
    {
1294
        $this->assertSearchResults(
1295
            [69],
1296
            $this->getContentSearchHandler()->findLocations(
1297
                new LocationQuery(
1298
                    [
1299
                        'filter' => new Criterion\FieldRelation(
1300
                            'billboard',
1301
                            Criterion\Operator::CONTAINS,
1302
                            [60, 75]
1303
                        ),
1304
                    ]
1305
                )
1306
            )
1307
        );
1308
    }
1309
1310
    public function testFieldRelationFilterContainsArrayNotMatch()
1311
    {
@@ 1328-1344 (lines=17) @@
1325
        );
1326
    }
1327
1328
    public function testFieldRelationFilterInArray()
1329
    {
1330
        $this->assertSearchResults(
1331
            [69, 77],
1332
            $this->getContentSearchHandler()->findLocations(
1333
                new LocationQuery(
1334
                    [
1335
                        'filter' => new Criterion\FieldRelation(
1336
                            'billboard',
1337
                            Criterion\Operator::IN,
1338
                            [60, 64]
1339
                        ),
1340
                    ]
1341
                )
1342
            )
1343
        );
1344
    }
1345
1346
    public function testFieldRelationFilterInArrayNotMatch()
1347
    {
@@ 1506-1526 (lines=21) @@
1503
        );
1504
    }
1505
1506
    public function testIsMainLocationFilter()
1507
    {
1508
        $this->assertSearchResults(
1509
            [225],
1510
            $this->getContentSearchHandler()->findLocations(
1511
                new LocationQuery(
1512
                    [
1513
                        'filter' => new Criterion\LogicalAnd(
1514
                            [
1515
                                new Criterion\ParentLocationId(224),
1516
                                new Criterion\Location\IsMainLocation(
1517
                                    Criterion\Location\IsMainLocation::MAIN
1518
                                ),
1519
                            ]
1520
                        ),
1521
                        'limit' => 10,
1522
                    ]
1523
                )
1524
            )
1525
        );
1526
    }
1527
1528
    public function testIsNotMainLocationFilter()
1529
    {
@@ 1528-1548 (lines=21) @@
1525
        );
1526
    }
1527
1528
    public function testIsNotMainLocationFilter()
1529
    {
1530
        $this->assertSearchResults(
1531
            [510],
1532
            $this->getContentSearchHandler()->findLocations(
1533
                new LocationQuery(
1534
                    [
1535
                        'filter' => new Criterion\LogicalAnd(
1536
                            [
1537
                                new Criterion\ParentLocationId(224),
1538
                                new Criterion\Location\IsMainLocation(
1539
                                    Criterion\Location\IsMainLocation::NOT_MAIN
1540
                                ),
1541
                            ]
1542
                        ),
1543
                        'limit' => 10,
1544
                    ]
1545
                )
1546
            )
1547
        );
1548
    }
1549
}
1550