Code Duplication    Length = 15-23 lines in 6 locations

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

@@ 383-405 (lines=23) @@
380
        );
381
    }
382
383
    public function testLocationIdAndCombinatorFilter()
384
    {
385
        $this->assertSearchResults(
386
            array(13),
387
            $this->getContentSearchHandler()->findLocations(
388
                new LocationQuery(
389
                    array(
390
                        'filter' => new Criterion\LogicalAnd(
391
                            array(
392
                                new Criterion\LocationId(
393
                                    array(4, 12, 13)
394
                                ),
395
                                new Criterion\LocationId(
396
                                    array(13, 44)
397
                                ),
398
                            )
399
                        ),
400
                        'limit' => 10,
401
                    )
402
                )
403
            )
404
        );
405
    }
406
407
    public function testLocationIdParentLocationIdAndCombinatorFilter()
408
    {
@@ 570-586 (lines=17) @@
567
        );
568
    }
569
570
    public function testVisibilityFilterVisible()
571
    {
572
        $this->assertSearchResults(
573
            array(2, 5, 12, 13, 14),
574
            $this->getContentSearchHandler()->findLocations(
575
                new LocationQuery(
576
                    array(
577
                        'filter' => new Criterion\Visibility(
578
                            Criterion\Visibility::VISIBLE
579
                        ),
580
                        'limit' => 5,
581
                        'sortClauses' => array(new SortClause\Location\Id()),
582
                    )
583
                )
584
            )
585
        );
586
    }
587
588
    public function testVisibilityFilterHidden()
589
    {
@@ 714-728 (lines=15) @@
711
        );
712
    }
713
714
    public function testContentTypeIdentifierFilter()
715
    {
716
        $this->assertSearchResults(
717
            array(43, 48, 51, 52, 53),
718
            $this->getContentSearchHandler()->findLocations(
719
                new LocationQuery(
720
                    array(
721
                        'filter' => new Criterion\ContentTypeIdentifier('folder'),
722
                        'limit' => 5,
723
                        'sortClauses' => array(new SortClause\Location\Id()),
724
                    )
725
                )
726
            )
727
        );
728
    }
729
730
    public function testObjectStateIdFilter()
731
    {
@@ 832-849 (lines=18) @@
829
        );
830
    }
831
832
    public function testDateMetadataFilterModifiedIn()
833
    {
834
        $this->assertSearchResults(
835
            array(12, 15, 227, 228),
836
            $this->getContentSearchHandler()->findLocations(
837
                new LocationQuery(
838
                    array(
839
                        'filter' => new Criterion\DateMetadata(
840
                            Criterion\DateMetadata::MODIFIED,
841
                            Criterion\Operator::IN,
842
                            array(1311154214, 1311154215)
843
                        ),
844
                        'limit' => 10,
845
                    )
846
                )
847
            )
848
        );
849
    }
850
851
    public function testDateMetadataFilterModifiedBetween()
852
    {
@@ 851-868 (lines=18) @@
848
        );
849
    }
850
851
    public function testDateMetadataFilterModifiedBetween()
852
    {
853
        $this->assertSearchResults(
854
            array(12, 15, 227, 228),
855
            $this->getContentSearchHandler()->findLocations(
856
                new LocationQuery(
857
                    array(
858
                        'filter' => new Criterion\DateMetadata(
859
                            Criterion\DateMetadata::MODIFIED,
860
                            Criterion\Operator::BETWEEN,
861
                            array(1311154213, 1311154215)
862
                        ),
863
                        'limit' => 10,
864
                    )
865
                )
866
            )
867
        );
868
    }
869
870
    public function testDateMetadataFilterCreatedBetween()
871
    {
@@ 870-887 (lines=18) @@
867
        );
868
    }
869
870
    public function testDateMetadataFilterCreatedBetween()
871
    {
872
        $this->assertSearchResults(
873
            array(68, 133, 227),
874
            $this->getContentSearchHandler()->findLocations(
875
                new LocationQuery(
876
                    array(
877
                        'filter' => new Criterion\DateMetadata(
878
                            Criterion\DateMetadata::CREATED,
879
                            Criterion\Operator::BETWEEN,
880
                            array(1299780749, 1311154215)
881
                        ),
882
                        'limit' => 10,
883
                    )
884
                )
885
            )
886
        );
887
    }
888
889
    public function testUserMetadataFilterOwnerWrongUserId()
890
    {