Code Duplication    Length = 22-22 lines in 4 locations

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

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