Code Duplication    Length = 15-23 lines in 6 locations

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

@@ 389-411 (lines=23) @@
386
        );
387
    }
388
389
    public function testLocationIdAndCombinatorFilter()
390
    {
391
        $this->assertSearchResults(
392
            array(13),
393
            $this->getContentSearchHandler()->findLocations(
394
                new LocationQuery(
395
                    array(
396
                        'filter' => new Criterion\LogicalAnd(
397
                            array(
398
                                new Criterion\LocationId(
399
                                    array(4, 12, 13)
400
                                ),
401
                                new Criterion\LocationId(
402
                                    array(13, 44)
403
                                ),
404
                            )
405
                        ),
406
                        'limit' => 10,
407
                    )
408
                )
409
            )
410
        );
411
    }
412
413
    public function testLocationIdParentLocationIdAndCombinatorFilter()
414
    {
@@ 576-592 (lines=17) @@
573
        );
574
    }
575
576
    public function testVisibilityFilterVisible()
577
    {
578
        $this->assertSearchResults(
579
            array(2, 5, 12, 13, 14),
580
            $this->getContentSearchHandler()->findLocations(
581
                new LocationQuery(
582
                    array(
583
                        'filter' => new Criterion\Visibility(
584
                            Criterion\Visibility::VISIBLE
585
                        ),
586
                        'limit' => 5,
587
                        'sortClauses' => array(new SortClause\Location\Id()),
588
                    )
589
                )
590
            )
591
        );
592
    }
593
594
    public function testVisibilityFilterHidden()
595
    {
@@ 720-734 (lines=15) @@
717
        );
718
    }
719
720
    public function testContentTypeIdentifierFilter()
721
    {
722
        $this->assertSearchResults(
723
            array(43, 48, 51, 52, 53),
724
            $this->getContentSearchHandler()->findLocations(
725
                new LocationQuery(
726
                    array(
727
                        'filter' => new Criterion\ContentTypeIdentifier('folder'),
728
                        'limit' => 5,
729
                        'sortClauses' => array(new SortClause\Location\Id()),
730
                    )
731
                )
732
            )
733
        );
734
    }
735
736
    public function testObjectStateIdFilter()
737
    {
@@ 838-855 (lines=18) @@
835
        );
836
    }
837
838
    public function testDateMetadataFilterModifiedIn()
839
    {
840
        $this->assertSearchResults(
841
            array(12, 15, 227, 228),
842
            $this->getContentSearchHandler()->findLocations(
843
                new LocationQuery(
844
                    array(
845
                        'filter' => new Criterion\DateMetadata(
846
                            Criterion\DateMetadata::MODIFIED,
847
                            Criterion\Operator::IN,
848
                            array(1311154214, 1311154215)
849
                        ),
850
                        'limit' => 10,
851
                    )
852
                )
853
            )
854
        );
855
    }
856
857
    public function testDateMetadataFilterModifiedBetween()
858
    {
@@ 857-874 (lines=18) @@
854
        );
855
    }
856
857
    public function testDateMetadataFilterModifiedBetween()
858
    {
859
        $this->assertSearchResults(
860
            array(12, 15, 227, 228),
861
            $this->getContentSearchHandler()->findLocations(
862
                new LocationQuery(
863
                    array(
864
                        'filter' => new Criterion\DateMetadata(
865
                            Criterion\DateMetadata::MODIFIED,
866
                            Criterion\Operator::BETWEEN,
867
                            array(1311154213, 1311154215)
868
                        ),
869
                        'limit' => 10,
870
                    )
871
                )
872
            )
873
        );
874
    }
875
876
    public function testDateMetadataFilterCreatedBetween()
877
    {
@@ 876-893 (lines=18) @@
873
        );
874
    }
875
876
    public function testDateMetadataFilterCreatedBetween()
877
    {
878
        $this->assertSearchResults(
879
            array(68, 133, 227),
880
            $this->getContentSearchHandler()->findLocations(
881
                new LocationQuery(
882
                    array(
883
                        'filter' => new Criterion\DateMetadata(
884
                            Criterion\DateMetadata::CREATED,
885
                            Criterion\Operator::BETWEEN,
886
                            array(1299780749, 1311154215)
887
                        ),
888
                        'limit' => 10,
889
                    )
890
                )
891
            )
892
        );
893
    }
894
895
    public function testUserMetadataFilterOwnerWrongUserId()
896
    {