Code Duplication    Length = 15-23 lines in 8 locations

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

@@ 392-414 (lines=23) @@
389
        );
390
    }
391
392
    public function testLocationIdAndCombinatorFilter()
393
    {
394
        $this->assertSearchResults(
395
            [13],
396
            $this->getContentSearchHandler()->findLocations(
397
                new LocationQuery(
398
                    [
399
                        'filter' => new Criterion\LogicalAnd(
400
                            [
401
                                new Criterion\LocationId(
402
                                    [4, 12, 13]
403
                                ),
404
                                new Criterion\LocationId(
405
                                    [13, 44]
406
                                ),
407
                            ]
408
                        ),
409
                        'limit' => 10,
410
                    ]
411
                )
412
            )
413
        );
414
    }
415
416
    public function testLocationIdParentLocationIdAndCombinatorFilter()
417
    {
@@ 579-595 (lines=17) @@
576
        );
577
    }
578
579
    public function testVisibilityFilterVisible()
580
    {
581
        $this->assertSearchResults(
582
            [2, 5, 12, 13, 14],
583
            $this->getContentSearchHandler()->findLocations(
584
                new LocationQuery(
585
                    [
586
                        'filter' => new Criterion\Visibility(
587
                            Criterion\Visibility::VISIBLE
588
                        ),
589
                        'limit' => 5,
590
                        'sortClauses' => [new SortClause\Location\Id()],
591
                    ]
592
                )
593
            )
594
        );
595
    }
596
597
    public function testVisibilityFilterHidden()
598
    {
@@ 723-737 (lines=15) @@
720
        );
721
    }
722
723
    public function testContentTypeIdentifierFilter()
724
    {
725
        $this->assertSearchResults(
726
            [43, 48, 51, 52, 53],
727
            $this->getContentSearchHandler()->findLocations(
728
                new LocationQuery(
729
                    [
730
                        'filter' => new Criterion\ContentTypeIdentifier('folder'),
731
                        'limit' => 5,
732
                        'sortClauses' => [new SortClause\Location\Id()],
733
                    ]
734
                )
735
            )
736
        );
737
    }
738
739
    public function testObjectStateIdFilter()
740
    {
@@ 841-858 (lines=18) @@
838
        );
839
    }
840
841
    public function testDateMetadataFilterModifiedIn()
842
    {
843
        $this->assertSearchResults(
844
            [12, 15, 227, 228],
845
            $this->getContentSearchHandler()->findLocations(
846
                new LocationQuery(
847
                    [
848
                        'filter' => new Criterion\DateMetadata(
849
                            Criterion\DateMetadata::MODIFIED,
850
                            Criterion\Operator::IN,
851
                            [1311154214, 1311154215]
852
                        ),
853
                        'limit' => 10,
854
                    ]
855
                )
856
            )
857
        );
858
    }
859
860
    public function testDateMetadataFilterModifiedBetween()
861
    {
@@ 860-877 (lines=18) @@
857
        );
858
    }
859
860
    public function testDateMetadataFilterModifiedBetween()
861
    {
862
        $this->assertSearchResults(
863
            [12, 15, 227, 228],
864
            $this->getContentSearchHandler()->findLocations(
865
                new LocationQuery(
866
                    [
867
                        'filter' => new Criterion\DateMetadata(
868
                            Criterion\DateMetadata::MODIFIED,
869
                            Criterion\Operator::BETWEEN,
870
                            [1311154213, 1311154215]
871
                        ),
872
                        'limit' => 10,
873
                    ]
874
                )
875
            )
876
        );
877
    }
878
879
    public function testDateMetadataFilterCreatedBetween()
880
    {
@@ 879-896 (lines=18) @@
876
        );
877
    }
878
879
    public function testDateMetadataFilterCreatedBetween()
880
    {
881
        $this->assertSearchResults(
882
            [68, 133, 227],
883
            $this->getContentSearchHandler()->findLocations(
884
                new LocationQuery(
885
                    [
886
                        'filter' => new Criterion\DateMetadata(
887
                            Criterion\DateMetadata::CREATED,
888
                            Criterion\Operator::BETWEEN,
889
                            [1299780749, 1311154215]
890
                        ),
891
                        'limit' => 10,
892
                    ]
893
                )
894
            )
895
        );
896
    }
897
898
    public function testUserMetadataFilterOwnerWrongUserId()
899
    {
@@ 1386-1403 (lines=18) @@
1383
        );
1384
    }
1385
1386
    public function testFieldFilterIn()
1387
    {
1388
        $this->assertSearchResults(
1389
            [12, 44],
1390
            $this->getContentSearchHandler()->findLocations(
1391
                new LocationQuery(
1392
                    [
1393
                        'filter' => new Criterion\Field(
1394
                            'name',
1395
                            Criterion\Operator::IN,
1396
                            ['members', 'anonymous users']
1397
                        ),
1398
                        'limit' => 10,
1399
                    ]
1400
                )
1401
            )
1402
        );
1403
    }
1404
1405
    public function testFieldFilterContainsPartial()
1406
    {
@@ 1462-1479 (lines=18) @@
1459
        );
1460
    }
1461
1462
    public function testFieldFilterBetween()
1463
    {
1464
        $this->assertSearchResults(
1465
            [71, 73, 74],
1466
            $this->getContentSearchHandler()->findLocations(
1467
                new LocationQuery(
1468
                    [
1469
                        'filter' => new Criterion\Field(
1470
                            'price',
1471
                            Criterion\Operator::BETWEEN,
1472
                            [10000, 1000000]
1473
                        ),
1474
                        'limit' => 10,
1475
                    ]
1476
                )
1477
            )
1478
        );
1479
    }
1480
1481
    public function testFieldFilterOr()
1482
    {