Code Duplication    Length = 17-17 lines in 3 locations

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

@@ 1740-1756 (lines=17) @@
1737
1738
        $this->assertEquals(count($contentDataList), $searchResult->totalCount);
1739
1740
        foreach ($contentDataList as $index => $contentData) {
1741
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1742
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1743
1744
            /** @var \eZ\Publish\Api\Repository\Values\Content\Content $content */
1745
            $content = $searchResult->searchHits[$index]->valueObject;
1746
1747
            $this->assertEquals(
1748
                $data[$contentNo]['content']->id,
1749
                $content->id
1750
            );
1751
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1752
            $this->assertEquals(
1753
                $translationLanguageCode,
1754
                $searchResult->searchHits[$index]->matchedTranslation
1755
            );
1756
        }
1757
    }
1758
1759
    /**
@@ 1794-1810 (lines=17) @@
1791
1792
        $this->assertEquals(count($contentDataList), $searchResult->totalCount);
1793
1794
        foreach ($contentDataList as $index => $contentData) {
1795
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1796
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1797
1798
            /** @var \eZ\Publish\Api\Repository\Values\Content\Location $location */
1799
            $location = $searchResult->searchHits[$index]->valueObject;
1800
1801
            $this->assertEquals(
1802
                $data[$contentNo]['locations'][0]->id,
1803
                $location->id
1804
            );
1805
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1806
            $this->assertEquals(
1807
                $translationLanguageCode,
1808
                $searchResult->searchHits[$index]->matchedTranslation
1809
            );
1810
        }
1811
    }
1812
1813
    /**
@@ 1844-1860 (lines=17) @@
1841
1842
        $this->assertEquals(count($contentDataList) * 2, $searchResult->totalCount);
1843
1844
        foreach ($contentDataList as $index => $contentData) {
1845
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;
1846
            list($index, $contentNo) = $this->getIndexesToMatchData($contentData, $index, $contentNo);
1847
1848
            /** @var \eZ\Publish\Api\Repository\Values\Content\Location $location */
1849
            $location = $searchResult->searchHits[$index]->valueObject;
1850
1851
            $this->assertEquals(
1852
                $data[$contentNo]['locations'][0]->id,
1853
                $location->id
1854
            );
1855
            $this->assertIndexName($indexMap, $searchResult->searchHits[$index]);
1856
            $this->assertEquals(
1857
                $translationLanguageCode,
1858
                $searchResult->searchHits[$index]->matchedTranslation
1859
            );
1860
        }
1861
1862
        foreach ($contentDataList as $index => $contentData) {
1863
            list($contentNo, $translationLanguageCode, $indexMap) = $contentData;