Code Duplication    Length = 15-23 lines in 6 locations

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

@@ 392-414 (lines=23) @@
389
        );
390
    }
391
392
    public function testLocationIdAndCombinatorFilter()
393
    {
394
        $this->assertSearchResults(
395
            array(13),
396
            $this->getContentSearchHandler()->findLocations(
397
                new LocationQuery(
398
                    array(
399
                        'filter' => new Criterion\LogicalAnd(
400
                            array(
401
                                new Criterion\LocationId(
402
                                    array(4, 12, 13)
403
                                ),
404
                                new Criterion\LocationId(
405
                                    array(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
            array(2, 5, 12, 13, 14),
583
            $this->getContentSearchHandler()->findLocations(
584
                new LocationQuery(
585
                    array(
586
                        'filter' => new Criterion\Visibility(
587
                            Criterion\Visibility::VISIBLE
588
                        ),
589
                        'limit' => 5,
590
                        'sortClauses' => array(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
            array(43, 48, 51, 52, 53),
727
            $this->getContentSearchHandler()->findLocations(
728
                new LocationQuery(
729
                    array(
730
                        'filter' => new Criterion\ContentTypeIdentifier('folder'),
731
                        'limit' => 5,
732
                        'sortClauses' => array(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
            array(12, 15, 227, 228),
845
            $this->getContentSearchHandler()->findLocations(
846
                new LocationQuery(
847
                    array(
848
                        'filter' => new Criterion\DateMetadata(
849
                            Criterion\DateMetadata::MODIFIED,
850
                            Criterion\Operator::IN,
851
                            array(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
            array(12, 15, 227, 228),
864
            $this->getContentSearchHandler()->findLocations(
865
                new LocationQuery(
866
                    array(
867
                        'filter' => new Criterion\DateMetadata(
868
                            Criterion\DateMetadata::MODIFIED,
869
                            Criterion\Operator::BETWEEN,
870
                            array(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
            array(68, 133, 227),
883
            $this->getContentSearchHandler()->findLocations(
884
                new LocationQuery(
885
                    array(
886
                        'filter' => new Criterion\DateMetadata(
887
                            Criterion\DateMetadata::CREATED,
888
                            Criterion\Operator::BETWEEN,
889
                            array(1299780749, 1311154215)
890
                        ),
891
                        'limit' => 10,
892
                    )
893
                )
894
            )
895
        );
896
    }
897
898
    public function testUserMetadataFilterOwnerWrongUserId()
899
    {