Code Duplication    Length = 22-22 lines in 4 locations

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

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