Code Duplication    Length = 22-22 lines in 4 locations

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

@@ 488-509 (lines=22) @@
485
        );
486
    }
487
488
    public function testSortLocationVisibilityAscending()
489
    {
490
        $handler = $this->getContentSearchHandler();
491
492
        $locations = $handler->findLocations(
493
            new LocationQuery(
494
                array(
495
                    'filter' => new Criterion\LocationId(array(45, 228)),
496
                    'offset' => 0,
497
                    'limit' => null,
498
                    'sortClauses' => array(
499
                        new SortClause\Location\Visibility(LocationQuery::SORT_ASC),
500
                    ),
501
                )
502
            )
503
        );
504
505
        $this->assertSearchResults(
506
            array(45, 228),
507
            $locations
508
        );
509
    }
510
511
    public function testSortLocationVisibilityDescending()
512
    {
@@ 511-532 (lines=22) @@
508
        );
509
    }
510
511
    public function testSortLocationVisibilityDescending()
512
    {
513
        $handler = $this->getContentSearchHandler();
514
515
        $locations = $handler->findLocations(
516
            new LocationQuery(
517
                array(
518
                    'filter' => new Criterion\LocationId(array(45, 228)),
519
                    'offset' => 0,
520
                    'limit' => null,
521
                    'sortClauses' => array(
522
                        new SortClause\Location\Visibility(LocationQuery::SORT_DESC),
523
                    ),
524
                )
525
            )
526
        );
527
528
        $this->assertSearchResults(
529
            array(228, 45),
530
            $locations
531
        );
532
    }
533
534
    public function testSortSectionName()
535
    {
@@ 691-712 (lines=22) @@
688
        );
689
    }
690
691
    public function testSortIsMainLocationAscending()
692
    {
693
        $handler = $this->getContentSearchHandler();
694
695
        $locations = $handler->findLocations(
696
            new LocationQuery(
697
                array(
698
                    'filter' => new Criterion\ParentLocationId(224),
699
                    'offset' => 0,
700
                    'limit' => null,
701
                    'sortClauses' => array(
702
                        new SortClause\Location\IsMainLocation(LocationQuery::SORT_ASC),
703
                    ),
704
                )
705
            )
706
        );
707
708
        $this->assertSearchResults(
709
            array(510, 225),
710
            $locations
711
        );
712
    }
713
714
    public function testSortIsMainLocationDescending()
715
    {
@@ 714-735 (lines=22) @@
711
        );
712
    }
713
714
    public function testSortIsMainLocationDescending()
715
    {
716
        $handler = $this->getContentSearchHandler();
717
718
        $locations = $handler->findLocations(
719
            new LocationQuery(
720
                array(
721
                    'filter' => new Criterion\ParentLocationId(224),
722
                    'offset' => 0,
723
                    'limit' => null,
724
                    'sortClauses' => array(
725
                        new SortClause\Location\IsMainLocation(LocationQuery::SORT_DESC),
726
                    ),
727
                )
728
            )
729
        );
730
731
        $this->assertSearchResults(
732
            array(225, 510),
733
            $locations
734
        );
735
    }
736
}
737