Code Duplication    Length = 9-9 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 2 locations

@@ 4414-4422 (lines=9) @@
4411
4412
        // Legacy search engine does have scoring, sorting the results by ID in that case
4413
        $setupFactory = $this->getSetupFactory();
4414
        if (get_class($setupFactory) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
4415
            $this->sortSearchHitsById($searchHits);
4416
4417
            $this->assertEquals($content1->id, $searchHits[0]->valueObject->id);
4418
            $this->assertEquals($content2->id, $searchHits[1]->valueObject->id);
4419
            $this->assertEquals($content3->id, $searchHits[2]->valueObject->id);
4420
4421
            return;
4422
        }
4423
4424
        // Assert scores are descending
4425
        $this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score);
@@ 4486-4494 (lines=9) @@
4483
4484
        // Legacy search engine does have scoring, sorting the results by ID in that case
4485
        $setupFactory = $this->getSetupFactory();
4486
        if (get_class($setupFactory) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
4487
            $this->sortSearchHitsById($searchHits);
4488
4489
            $this->assertEquals($content1->id, $searchHits[0]->valueObject->contentId);
4490
            $this->assertEquals($content2->id, $searchHits[1]->valueObject->contentId);
4491
            $this->assertEquals($content3->id, $searchHits[2]->valueObject->contentId);
4492
4493
            return;
4494
        }
4495
4496
        // Assert scores are descending
4497
        $this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score);