|
@@ 977-1001 (lines=25) @@
|
| 974 |
|
* |
| 975 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesEmpty |
| 976 |
|
*/ |
| 977 |
|
public function testListAutogeneratedLocationAliasesEmpty($spiUrlAliases, $prioritizedLanguageCodes) |
| 978 |
|
{ |
| 979 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 980 |
|
$configuration = array( |
| 981 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 982 |
|
'showAllTranslations' => false, |
| 983 |
|
); |
| 984 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 985 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 986 |
|
$urlAliasHandler->expects( |
| 987 |
|
$this->once() |
| 988 |
|
)->method( |
| 989 |
|
'listURLAliasesForLocation' |
| 990 |
|
)->with( |
| 991 |
|
$this->equalTo(42), |
| 992 |
|
$this->equalTo(false) |
| 993 |
|
)->will( |
| 994 |
|
$this->returnValue($spiUrlAliases) |
| 995 |
|
); |
| 996 |
|
|
| 997 |
|
$location = $this->getLocationStub(); |
| 998 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, null); |
| 999 |
|
|
| 1000 |
|
self::assertEmpty($urlAliases); |
| 1001 |
|
} |
| 1002 |
|
|
| 1003 |
|
/** |
| 1004 |
|
* Test for the listLocationAliases() method. |
|
@@ 1008-1040 (lines=33) @@
|
| 1005 |
|
* |
| 1006 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesEmpty |
| 1007 |
|
*/ |
| 1008 |
|
public function testListAutogeneratedLocationAliasesEmptyCustomConfiguration( |
| 1009 |
|
$spiUrlAliases, |
| 1010 |
|
$prioritizedLanguageCodes |
| 1011 |
|
) { |
| 1012 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 1013 |
|
$configuration = array( |
| 1014 |
|
'prioritizedLanguageList' => array(), |
| 1015 |
|
'showAllTranslations' => false, |
| 1016 |
|
); |
| 1017 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1018 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 1019 |
|
$urlAliasHandler->expects( |
| 1020 |
|
$this->once() |
| 1021 |
|
)->method( |
| 1022 |
|
'listURLAliasesForLocation' |
| 1023 |
|
)->with( |
| 1024 |
|
$this->equalTo(42), |
| 1025 |
|
$this->equalTo(false) |
| 1026 |
|
)->will( |
| 1027 |
|
$this->returnValue($spiUrlAliases) |
| 1028 |
|
); |
| 1029 |
|
|
| 1030 |
|
$location = $this->getLocationStub(); |
| 1031 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 1032 |
|
$location, |
| 1033 |
|
false, |
| 1034 |
|
null, |
| 1035 |
|
false, |
| 1036 |
|
$prioritizedLanguageCodes |
| 1037 |
|
); |
| 1038 |
|
|
| 1039 |
|
self::assertEmpty($urlAliases); |
| 1040 |
|
} |
| 1041 |
|
|
| 1042 |
|
public function providerForTestListAutogeneratedLocationAliasesWithLanguageCodePath() |
| 1043 |
|
{ |
|
@@ 1651-1678 (lines=28) @@
|
| 1648 |
|
* |
| 1649 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeEmpty |
| 1650 |
|
*/ |
| 1651 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeEmpty( |
| 1652 |
|
$spiUrlAliases, |
| 1653 |
|
$languageCode, |
| 1654 |
|
$prioritizedLanguageCodes |
| 1655 |
|
) { |
| 1656 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 1657 |
|
$configuration = array( |
| 1658 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 1659 |
|
'showAllTranslations' => false, |
| 1660 |
|
); |
| 1661 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1662 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 1663 |
|
$urlAliasHandler->expects( |
| 1664 |
|
$this->once() |
| 1665 |
|
)->method( |
| 1666 |
|
'listURLAliasesForLocation' |
| 1667 |
|
)->with( |
| 1668 |
|
$this->equalTo(42), |
| 1669 |
|
$this->equalTo(false) |
| 1670 |
|
)->will( |
| 1671 |
|
$this->returnValue($spiUrlAliases) |
| 1672 |
|
); |
| 1673 |
|
|
| 1674 |
|
$location = $this->getLocationStub(); |
| 1675 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 1676 |
|
|
| 1677 |
|
self::assertEmpty($urlAliases); |
| 1678 |
|
} |
| 1679 |
|
|
| 1680 |
|
/** |
| 1681 |
|
* Test for the listLocationAliases() method. |
|
@@ 1685-1718 (lines=34) @@
|
| 1682 |
|
* |
| 1683 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeEmpty |
| 1684 |
|
*/ |
| 1685 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeEmptyCustomConfiguration( |
| 1686 |
|
$spiUrlAliases, |
| 1687 |
|
$languageCode, |
| 1688 |
|
$prioritizedLanguageCodes |
| 1689 |
|
) { |
| 1690 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 1691 |
|
$configuration = array( |
| 1692 |
|
'prioritizedLanguageList' => array(), |
| 1693 |
|
'showAllTranslations' => false, |
| 1694 |
|
); |
| 1695 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1696 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 1697 |
|
$urlAliasHandler->expects( |
| 1698 |
|
$this->once() |
| 1699 |
|
)->method( |
| 1700 |
|
'listURLAliasesForLocation' |
| 1701 |
|
)->with( |
| 1702 |
|
$this->equalTo(42), |
| 1703 |
|
$this->equalTo(false) |
| 1704 |
|
)->will( |
| 1705 |
|
$this->returnValue($spiUrlAliases) |
| 1706 |
|
); |
| 1707 |
|
|
| 1708 |
|
$location = $this->getLocationStub(); |
| 1709 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 1710 |
|
$location, |
| 1711 |
|
false, |
| 1712 |
|
$languageCode, |
| 1713 |
|
false, |
| 1714 |
|
$prioritizedLanguageCodes |
| 1715 |
|
); |
| 1716 |
|
|
| 1717 |
|
self::assertEmpty($urlAliases); |
| 1718 |
|
} |
| 1719 |
|
|
| 1720 |
|
public function providerForTestListAutogeneratedLocationAliasesMultipleLanguagesPath() |
| 1721 |
|
{ |
|
@@ 1914-1938 (lines=25) @@
|
| 1911 |
|
* |
| 1912 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesMultipleLanguagesEmpty |
| 1913 |
|
*/ |
| 1914 |
|
public function testListAutogeneratedLocationAliasesMultipleLanguagesEmpty($spiUrlAliases, $prioritizedLanguageCodes) |
| 1915 |
|
{ |
| 1916 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 1917 |
|
$configuration = array( |
| 1918 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 1919 |
|
'showAllTranslations' => false, |
| 1920 |
|
); |
| 1921 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1922 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 1923 |
|
$urlAliasHandler->expects( |
| 1924 |
|
$this->once() |
| 1925 |
|
)->method( |
| 1926 |
|
'listURLAliasesForLocation' |
| 1927 |
|
)->with( |
| 1928 |
|
$this->equalTo(42), |
| 1929 |
|
$this->equalTo(false) |
| 1930 |
|
)->will( |
| 1931 |
|
$this->returnValue($spiUrlAliases) |
| 1932 |
|
); |
| 1933 |
|
|
| 1934 |
|
$location = $this->getLocationStub(); |
| 1935 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, null); |
| 1936 |
|
|
| 1937 |
|
self::assertEmpty($urlAliases); |
| 1938 |
|
} |
| 1939 |
|
|
| 1940 |
|
/** |
| 1941 |
|
* Test for the listLocationAliases() method. |
|
@@ 1945-1977 (lines=33) @@
|
| 1942 |
|
* |
| 1943 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesMultipleLanguagesEmpty |
| 1944 |
|
*/ |
| 1945 |
|
public function testListAutogeneratedLocationAliasesMultipleLanguagesEmptyCustomConfiguration( |
| 1946 |
|
$spiUrlAliases, |
| 1947 |
|
$prioritizedLanguageCodes |
| 1948 |
|
) { |
| 1949 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 1950 |
|
$configuration = array( |
| 1951 |
|
'prioritizedLanguageList' => array(), |
| 1952 |
|
'showAllTranslations' => false, |
| 1953 |
|
); |
| 1954 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1955 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 1956 |
|
$urlAliasHandler->expects( |
| 1957 |
|
$this->once() |
| 1958 |
|
)->method( |
| 1959 |
|
'listURLAliasesForLocation' |
| 1960 |
|
)->with( |
| 1961 |
|
$this->equalTo(42), |
| 1962 |
|
$this->equalTo(false) |
| 1963 |
|
)->will( |
| 1964 |
|
$this->returnValue($spiUrlAliases) |
| 1965 |
|
); |
| 1966 |
|
|
| 1967 |
|
$location = $this->getLocationStub(); |
| 1968 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 1969 |
|
$location, |
| 1970 |
|
false, |
| 1971 |
|
null, |
| 1972 |
|
false, |
| 1973 |
|
$prioritizedLanguageCodes |
| 1974 |
|
); |
| 1975 |
|
|
| 1976 |
|
self::assertEmpty($urlAliases); |
| 1977 |
|
} |
| 1978 |
|
|
| 1979 |
|
public function providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesPath() |
| 1980 |
|
{ |
|
@@ 2194-2221 (lines=28) @@
|
| 2191 |
|
* |
| 2192 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty |
| 2193 |
|
*/ |
| 2194 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty( |
| 2195 |
|
$spiUrlAliases, |
| 2196 |
|
$languageCode, |
| 2197 |
|
$prioritizedLanguageCodes |
| 2198 |
|
) { |
| 2199 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 2200 |
|
$configuration = array( |
| 2201 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 2202 |
|
'showAllTranslations' => false, |
| 2203 |
|
); |
| 2204 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2205 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 2206 |
|
$urlAliasHandler->expects( |
| 2207 |
|
$this->once() |
| 2208 |
|
)->method( |
| 2209 |
|
'listURLAliasesForLocation' |
| 2210 |
|
)->with( |
| 2211 |
|
$this->equalTo(42), |
| 2212 |
|
$this->equalTo(false) |
| 2213 |
|
)->will( |
| 2214 |
|
$this->returnValue($spiUrlAliases) |
| 2215 |
|
); |
| 2216 |
|
|
| 2217 |
|
$location = $this->getLocationStub(); |
| 2218 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 2219 |
|
|
| 2220 |
|
self::assertEmpty($urlAliases); |
| 2221 |
|
} |
| 2222 |
|
|
| 2223 |
|
/** |
| 2224 |
|
* Test for the listLocationAliases() method. |
|
@@ 2228-2261 (lines=34) @@
|
| 2225 |
|
* |
| 2226 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty |
| 2227 |
|
*/ |
| 2228 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmptyCustomConfiguration( |
| 2229 |
|
$spiUrlAliases, |
| 2230 |
|
$languageCode, |
| 2231 |
|
$prioritizedLanguageCodes |
| 2232 |
|
) { |
| 2233 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 2234 |
|
$configuration = array( |
| 2235 |
|
'prioritizedLanguageList' => array(), |
| 2236 |
|
'showAllTranslations' => false, |
| 2237 |
|
); |
| 2238 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2239 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 2240 |
|
$urlAliasHandler->expects( |
| 2241 |
|
$this->once() |
| 2242 |
|
)->method( |
| 2243 |
|
'listURLAliasesForLocation' |
| 2244 |
|
)->with( |
| 2245 |
|
$this->equalTo(42), |
| 2246 |
|
$this->equalTo(false) |
| 2247 |
|
)->will( |
| 2248 |
|
$this->returnValue($spiUrlAliases) |
| 2249 |
|
); |
| 2250 |
|
|
| 2251 |
|
$location = $this->getLocationStub(); |
| 2252 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 2253 |
|
$location, |
| 2254 |
|
false, |
| 2255 |
|
$languageCode, |
| 2256 |
|
false, |
| 2257 |
|
$prioritizedLanguageCodes |
| 2258 |
|
); |
| 2259 |
|
|
| 2260 |
|
self::assertEmpty($urlAliases); |
| 2261 |
|
} |
| 2262 |
|
|
| 2263 |
|
public function providerForTestListAutogeneratedLocationAliasesAlwaysAvailablePath() |
| 2264 |
|
{ |
|
@@ 2614-2641 (lines=28) @@
|
| 2611 |
|
* |
| 2612 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty |
| 2613 |
|
*/ |
| 2614 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty( |
| 2615 |
|
$spiUrlAliases, |
| 2616 |
|
$languageCode, |
| 2617 |
|
$prioritizedLanguageCodes |
| 2618 |
|
) { |
| 2619 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 2620 |
|
$configuration = array( |
| 2621 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 2622 |
|
'showAllTranslations' => false, |
| 2623 |
|
); |
| 2624 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2625 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 2626 |
|
$urlAliasHandler->expects( |
| 2627 |
|
$this->once() |
| 2628 |
|
)->method( |
| 2629 |
|
'listURLAliasesForLocation' |
| 2630 |
|
)->with( |
| 2631 |
|
$this->equalTo(42), |
| 2632 |
|
$this->equalTo(false) |
| 2633 |
|
)->will( |
| 2634 |
|
$this->returnValue($spiUrlAliases) |
| 2635 |
|
); |
| 2636 |
|
|
| 2637 |
|
$location = $this->getLocationStub(); |
| 2638 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 2639 |
|
|
| 2640 |
|
self::assertEmpty($urlAliases); |
| 2641 |
|
} |
| 2642 |
|
|
| 2643 |
|
/** |
| 2644 |
|
* Test for the listLocationAliases() method. |
|
@@ 2648-2681 (lines=34) @@
|
| 2645 |
|
* |
| 2646 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty |
| 2647 |
|
*/ |
| 2648 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmptyCustomConfiguration( |
| 2649 |
|
$spiUrlAliases, |
| 2650 |
|
$languageCode, |
| 2651 |
|
$prioritizedLanguageCodes |
| 2652 |
|
) { |
| 2653 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 2654 |
|
$configuration = array( |
| 2655 |
|
'prioritizedLanguageList' => array(), |
| 2656 |
|
'showAllTranslations' => false, |
| 2657 |
|
); |
| 2658 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2659 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 2660 |
|
$urlAliasHandler->expects( |
| 2661 |
|
$this->once() |
| 2662 |
|
)->method( |
| 2663 |
|
'listURLAliasesForLocation' |
| 2664 |
|
)->with( |
| 2665 |
|
$this->equalTo(42), |
| 2666 |
|
$this->equalTo(false) |
| 2667 |
|
)->will( |
| 2668 |
|
$this->returnValue($spiUrlAliases) |
| 2669 |
|
); |
| 2670 |
|
|
| 2671 |
|
$location = $this->getLocationStub(); |
| 2672 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 2673 |
|
$location, |
| 2674 |
|
false, |
| 2675 |
|
$languageCode, |
| 2676 |
|
false, |
| 2677 |
|
$prioritizedLanguageCodes |
| 2678 |
|
); |
| 2679 |
|
|
| 2680 |
|
self::assertEmpty($urlAliases); |
| 2681 |
|
} |
| 2682 |
|
|
| 2683 |
|
/** |
| 2684 |
|
* Test for the listGlobalAliases() method. |
|
@@ 3152-3182 (lines=31) @@
|
| 3149 |
|
* |
| 3150 |
|
* @dataProvider providerForTestReverseLookupAlwaysAvailablePath |
| 3151 |
|
*/ |
| 3152 |
|
public function testReverseLookupAlwaysAvailablePath( |
| 3153 |
|
$spiUrlAliases, |
| 3154 |
|
$prioritizedLanguageCodes, |
| 3155 |
|
$paths |
| 3156 |
|
) { |
| 3157 |
|
$urlAliasService = $this->getRepository()->getURLAliasService(); |
| 3158 |
|
$configuration = array( |
| 3159 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 3160 |
|
'showAllTranslations' => false, |
| 3161 |
|
); |
| 3162 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 3163 |
|
$urlAliasHandler = $this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'); |
| 3164 |
|
$urlAliasHandler->expects( |
| 3165 |
|
$this->once() |
| 3166 |
|
)->method( |
| 3167 |
|
'listURLAliasesForLocation' |
| 3168 |
|
)->with( |
| 3169 |
|
$this->equalTo(42), |
| 3170 |
|
$this->equalTo(false) |
| 3171 |
|
)->will( |
| 3172 |
|
$this->returnValue($spiUrlAliases) |
| 3173 |
|
); |
| 3174 |
|
|
| 3175 |
|
$location = $this->getLocationStub(); |
| 3176 |
|
$urlAlias = $urlAliasService->reverseLookup($location); |
| 3177 |
|
|
| 3178 |
|
self::assertEquals( |
| 3179 |
|
reset($paths), |
| 3180 |
|
$urlAlias->path |
| 3181 |
|
); |
| 3182 |
|
} |
| 3183 |
|
|
| 3184 |
|
/** |
| 3185 |
|
* Test for the reverseLookup() method. |