|
@@ 917-931 (lines=15) @@
|
| 914 |
|
* |
| 915 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesEmpty |
| 916 |
|
*/ |
| 917 |
|
public function testListAutogeneratedLocationAliasesEmpty($spiUrlAliases, $prioritizedLanguageCodes) |
| 918 |
|
{ |
| 919 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 920 |
|
$configuration = [ |
| 921 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 922 |
|
'showAllTranslations' => false, |
| 923 |
|
]; |
| 924 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 925 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 926 |
|
|
| 927 |
|
$location = $this->getLocationStub(); |
| 928 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, null); |
| 929 |
|
|
| 930 |
|
self::assertEmpty($urlAliases); |
| 931 |
|
} |
| 932 |
|
|
| 933 |
|
/** |
| 934 |
|
* Test for the listLocationAliases() method. |
|
@@ 938-960 (lines=23) @@
|
| 935 |
|
* |
| 936 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesEmpty |
| 937 |
|
*/ |
| 938 |
|
public function testListAutogeneratedLocationAliasesEmptyCustomConfiguration( |
| 939 |
|
$spiUrlAliases, |
| 940 |
|
$prioritizedLanguageCodes |
| 941 |
|
) { |
| 942 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 943 |
|
$configuration = [ |
| 944 |
|
'prioritizedLanguageList' => [], |
| 945 |
|
'showAllTranslations' => false, |
| 946 |
|
]; |
| 947 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 948 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 949 |
|
|
| 950 |
|
$location = $this->getLocationStub(); |
| 951 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 952 |
|
$location, |
| 953 |
|
false, |
| 954 |
|
null, |
| 955 |
|
false, |
| 956 |
|
$prioritizedLanguageCodes |
| 957 |
|
); |
| 958 |
|
|
| 959 |
|
self::assertEmpty($urlAliases); |
| 960 |
|
} |
| 961 |
|
|
| 962 |
|
public function providerForTestListAutogeneratedLocationAliasesWithLanguageCodePath() |
| 963 |
|
{ |
|
@@ 1551-1568 (lines=18) @@
|
| 1548 |
|
* |
| 1549 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeEmpty |
| 1550 |
|
*/ |
| 1551 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeEmpty( |
| 1552 |
|
$spiUrlAliases, |
| 1553 |
|
$languageCode, |
| 1554 |
|
$prioritizedLanguageCodes |
| 1555 |
|
) { |
| 1556 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 1557 |
|
$configuration = [ |
| 1558 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 1559 |
|
'showAllTranslations' => false, |
| 1560 |
|
]; |
| 1561 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1562 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 1563 |
|
|
| 1564 |
|
$location = $this->getLocationStub(); |
| 1565 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 1566 |
|
|
| 1567 |
|
self::assertEmpty($urlAliases); |
| 1568 |
|
} |
| 1569 |
|
|
| 1570 |
|
/** |
| 1571 |
|
* Test for the listLocationAliases() method. |
|
@@ 1575-1598 (lines=24) @@
|
| 1572 |
|
* |
| 1573 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeEmpty |
| 1574 |
|
*/ |
| 1575 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeEmptyCustomConfiguration( |
| 1576 |
|
$spiUrlAliases, |
| 1577 |
|
$languageCode, |
| 1578 |
|
$prioritizedLanguageCodes |
| 1579 |
|
) { |
| 1580 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 1581 |
|
$configuration = [ |
| 1582 |
|
'prioritizedLanguageList' => [], |
| 1583 |
|
'showAllTranslations' => false, |
| 1584 |
|
]; |
| 1585 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1586 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 1587 |
|
|
| 1588 |
|
$location = $this->getLocationStub(); |
| 1589 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 1590 |
|
$location, |
| 1591 |
|
false, |
| 1592 |
|
$languageCode, |
| 1593 |
|
false, |
| 1594 |
|
$prioritizedLanguageCodes |
| 1595 |
|
); |
| 1596 |
|
|
| 1597 |
|
self::assertEmpty($urlAliases); |
| 1598 |
|
} |
| 1599 |
|
|
| 1600 |
|
public function providerForTestListAutogeneratedLocationAliasesMultipleLanguagesPath() |
| 1601 |
|
{ |
|
@@ 1774-1788 (lines=15) @@
|
| 1771 |
|
* |
| 1772 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesMultipleLanguagesEmpty |
| 1773 |
|
*/ |
| 1774 |
|
public function testListAutogeneratedLocationAliasesMultipleLanguagesEmpty($spiUrlAliases, $prioritizedLanguageCodes) |
| 1775 |
|
{ |
| 1776 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 1777 |
|
$configuration = [ |
| 1778 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 1779 |
|
'showAllTranslations' => false, |
| 1780 |
|
]; |
| 1781 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1782 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 1783 |
|
|
| 1784 |
|
$location = $this->getLocationStub(); |
| 1785 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, null); |
| 1786 |
|
|
| 1787 |
|
self::assertEmpty($urlAliases); |
| 1788 |
|
} |
| 1789 |
|
|
| 1790 |
|
/** |
| 1791 |
|
* Test for the listLocationAliases() method. |
|
@@ 1795-1817 (lines=23) @@
|
| 1792 |
|
* |
| 1793 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesMultipleLanguagesEmpty |
| 1794 |
|
*/ |
| 1795 |
|
public function testListAutogeneratedLocationAliasesMultipleLanguagesEmptyCustomConfiguration( |
| 1796 |
|
$spiUrlAliases, |
| 1797 |
|
$prioritizedLanguageCodes |
| 1798 |
|
) { |
| 1799 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 1800 |
|
$configuration = [ |
| 1801 |
|
'prioritizedLanguageList' => [], |
| 1802 |
|
'showAllTranslations' => false, |
| 1803 |
|
]; |
| 1804 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 1805 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 1806 |
|
|
| 1807 |
|
$location = $this->getLocationStub(); |
| 1808 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 1809 |
|
$location, |
| 1810 |
|
false, |
| 1811 |
|
null, |
| 1812 |
|
false, |
| 1813 |
|
$prioritizedLanguageCodes |
| 1814 |
|
); |
| 1815 |
|
|
| 1816 |
|
self::assertEmpty($urlAliases); |
| 1817 |
|
} |
| 1818 |
|
|
| 1819 |
|
public function providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesPath() |
| 1820 |
|
{ |
|
@@ 2014-2031 (lines=18) @@
|
| 2011 |
|
* |
| 2012 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty |
| 2013 |
|
*/ |
| 2014 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty( |
| 2015 |
|
$spiUrlAliases, |
| 2016 |
|
$languageCode, |
| 2017 |
|
$prioritizedLanguageCodes |
| 2018 |
|
) { |
| 2019 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 2020 |
|
$configuration = [ |
| 2021 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 2022 |
|
'showAllTranslations' => false, |
| 2023 |
|
]; |
| 2024 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2025 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 2026 |
|
|
| 2027 |
|
$location = $this->getLocationStub(); |
| 2028 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 2029 |
|
|
| 2030 |
|
self::assertEmpty($urlAliases); |
| 2031 |
|
} |
| 2032 |
|
|
| 2033 |
|
/** |
| 2034 |
|
* Test for the listLocationAliases() method. |
|
@@ 2038-2061 (lines=24) @@
|
| 2035 |
|
* |
| 2036 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmpty |
| 2037 |
|
*/ |
| 2038 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeMultipleLanguagesEmptyCustomConfiguration( |
| 2039 |
|
$spiUrlAliases, |
| 2040 |
|
$languageCode, |
| 2041 |
|
$prioritizedLanguageCodes |
| 2042 |
|
) { |
| 2043 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 2044 |
|
$configuration = [ |
| 2045 |
|
'prioritizedLanguageList' => [], |
| 2046 |
|
'showAllTranslations' => false, |
| 2047 |
|
]; |
| 2048 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2049 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 2050 |
|
|
| 2051 |
|
$location = $this->getLocationStub(); |
| 2052 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 2053 |
|
$location, |
| 2054 |
|
false, |
| 2055 |
|
$languageCode, |
| 2056 |
|
false, |
| 2057 |
|
$prioritizedLanguageCodes |
| 2058 |
|
); |
| 2059 |
|
|
| 2060 |
|
self::assertEmpty($urlAliases); |
| 2061 |
|
} |
| 2062 |
|
|
| 2063 |
|
public function providerForTestListAutogeneratedLocationAliasesAlwaysAvailablePath() |
| 2064 |
|
{ |
|
@@ 2374-2391 (lines=18) @@
|
| 2371 |
|
* |
| 2372 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty |
| 2373 |
|
*/ |
| 2374 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty( |
| 2375 |
|
$spiUrlAliases, |
| 2376 |
|
$languageCode, |
| 2377 |
|
$prioritizedLanguageCodes |
| 2378 |
|
) { |
| 2379 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 2380 |
|
$configuration = [ |
| 2381 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 2382 |
|
'showAllTranslations' => false, |
| 2383 |
|
]; |
| 2384 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2385 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 2386 |
|
|
| 2387 |
|
$location = $this->getLocationStub(); |
| 2388 |
|
$urlAliases = $urlAliasService->listLocationAliases($location, false, $languageCode); |
| 2389 |
|
|
| 2390 |
|
self::assertEmpty($urlAliases); |
| 2391 |
|
} |
| 2392 |
|
|
| 2393 |
|
/** |
| 2394 |
|
* Test for the listLocationAliases() method. |
|
@@ 2398-2421 (lines=24) @@
|
| 2395 |
|
* |
| 2396 |
|
* @dataProvider providerForTestListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmpty |
| 2397 |
|
*/ |
| 2398 |
|
public function testListAutogeneratedLocationAliasesWithLanguageCodeAlwaysAvailableEmptyCustomConfiguration( |
| 2399 |
|
$spiUrlAliases, |
| 2400 |
|
$languageCode, |
| 2401 |
|
$prioritizedLanguageCodes |
| 2402 |
|
) { |
| 2403 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 2404 |
|
$configuration = [ |
| 2405 |
|
'prioritizedLanguageList' => [], |
| 2406 |
|
'showAllTranslations' => false, |
| 2407 |
|
]; |
| 2408 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2409 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 2410 |
|
|
| 2411 |
|
$location = $this->getLocationStub(); |
| 2412 |
|
$urlAliases = $urlAliasService->listLocationAliases( |
| 2413 |
|
$location, |
| 2414 |
|
false, |
| 2415 |
|
$languageCode, |
| 2416 |
|
false, |
| 2417 |
|
$prioritizedLanguageCodes |
| 2418 |
|
); |
| 2419 |
|
|
| 2420 |
|
self::assertEmpty($urlAliases); |
| 2421 |
|
} |
| 2422 |
|
|
| 2423 |
|
/** |
| 2424 |
|
* Test for the listGlobalAliases() method. |
|
@@ 2875-2895 (lines=21) @@
|
| 2872 |
|
* |
| 2873 |
|
* @dataProvider providerForTestReverseLookupAlwaysAvailablePath |
| 2874 |
|
*/ |
| 2875 |
|
public function testReverseLookupAlwaysAvailablePath( |
| 2876 |
|
$spiUrlAliases, |
| 2877 |
|
$prioritizedLanguageCodes, |
| 2878 |
|
$paths |
| 2879 |
|
) { |
| 2880 |
|
$urlAliasService = $this->getPartlyMockedURLAliasServiceService(); |
| 2881 |
|
$configuration = [ |
| 2882 |
|
'prioritizedLanguageList' => $prioritizedLanguageCodes, |
| 2883 |
|
'showAllTranslations' => false, |
| 2884 |
|
]; |
| 2885 |
|
$this->setConfiguration($urlAliasService, $configuration); |
| 2886 |
|
$this->configureListURLAliasesForLocation($spiUrlAliases); |
| 2887 |
|
|
| 2888 |
|
$location = $this->getLocationStub(); |
| 2889 |
|
$urlAlias = $urlAliasService->reverseLookup($location); |
| 2890 |
|
|
| 2891 |
|
self::assertEquals( |
| 2892 |
|
reset($paths), |
| 2893 |
|
$urlAlias->path |
| 2894 |
|
); |
| 2895 |
|
} |
| 2896 |
|
|
| 2897 |
|
/** |
| 2898 |
|
* Test for the reverseLookup() method. |