Code Duplication    Length = 17-17 lines in 3 locations

eZ/Publish/API/Repository/Tests/SearchServiceTranslationLanguageFallbackTest.php 3 locations

@@ 1647-1663 (lines=17) @@
1644
1645
        $this->assertEquals(count($contentDataList), $searchResult->totalCount);
1646
1647
        foreach ($contentDataList as $index => $contentData) {
1648
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1649
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1650
1651
            /** @var \eZ\Publish\Api\Repository\Values\Content\Content $content */
1652
            $content = $searchResult->searchHits[$index]->valueObject;
1653
1654
            $this->assertEquals(
1655
                $data[$contentNo]['content']->id,
1656
                $content->id
1657
            );
1658
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1659
            $this->assertEquals(
1660
                $translationLanguageCode,
1661
                $searchResult->searchHits[$index]->matchedTranslation
1662
            );
1663
        }
1664
    }
1665
1666
    /**
@@ 1701-1717 (lines=17) @@
1698
1699
        $this->assertEquals(count($contentDataList), $searchResult->totalCount);
1700
1701
        foreach ($contentDataList as $index => $contentData) {
1702
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1703
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1704
1705
            /** @var \eZ\Publish\Api\Repository\Values\Content\Location $location */
1706
            $location = $searchResult->searchHits[$index]->valueObject;
1707
1708
            $this->assertEquals(
1709
                $data[$contentNo]['locations'][0]->id,
1710
                $location->id
1711
            );
1712
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1713
            $this->assertEquals(
1714
                $translationLanguageCode,
1715
                $searchResult->searchHits[$index]->matchedTranslation
1716
            );
1717
        }
1718
    }
1719
1720
    /**
@@ 1751-1767 (lines=17) @@
1748
1749
        $this->assertEquals(count($contentDataList) * 2, $searchResult->totalCount);
1750
1751
        foreach ($contentDataList as $index => $contentData) {
1752
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1753
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1754
1755
            /** @var \eZ\Publish\Api\Repository\Values\Content\Location $location */
1756
            $location = $searchResult->searchHits[$index]->valueObject;
1757
1758
            $this->assertEquals(
1759
                $data[$contentNo]['locations'][0]->id,
1760
                $location->id
1761
            );
1762
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1763
            $this->assertEquals(
1764
                $translationLanguageCode,
1765
                $searchResult->searchHits[$index]->matchedTranslation
1766
            );
1767
        }
1768
1769
        foreach ($contentDataList as $index => $contentData) {
1770
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;