11 private static $allAllowedLocales = [
12 'af_ZA',
'ar_DZ',
'ar_EG',
'ar_KW',
'ar_MA',
'ar_SA',
'az_Latn_AZ',
'be_BY',
'bg_BG',
'bn_BD',
13 'bs_Latn_BA',
'ca_ES',
'cs_CZ',
'cy_GB',
'da_DK',
'de_AT',
'de_CH',
'de_DE',
'el_GR',
'en_AU',
14 'en_CA',
'en_GB',
'en_NZ',
'en_US',
'es_AR',
'es_CO',
'es_PA',
'gl_ES',
'es_CR',
'es_ES',
15 'es_MX',
'eu_ES',
'es_PE',
'et_EE',
'fa_IR',
'fi_FI',
'fil_PH',
'fr_CA',
'fr_FR',
'gu_IN',
16 'he_IL',
'hi_IN',
'hr_HR',
'hu_HU',
'id_ID',
'is_IS',
'it_CH',
'it_IT',
'ja_JP',
'ka_GE',
17 'km_KH',
'ko_KR',
'lo_LA',
'lt_LT',
'lv_LV',
'mk_MK',
'mn_Cyrl_MN',
'ms_Latn_MY',
'nl_NL',
'nb_NO',
18 'nn_NO',
'pl_PL',
'pt_BR',
'pt_PT',
'ro_RO',
'ru_RU',
'sk_SK',
'sl_SI',
'sq_AL',
'sr_Cyrl_RS',
19 'sv_SE',
'sw_KE',
'th_TH',
'tr_TR',
'uk_UA',
'vi_VN',
'zh_Hans_CN',
'zh_Hant_HK',
'zh_Hant_TW',
'es_CL',
20 'lo_LA',
'es_VE',
'en_IE',
23 private static $allAllowedCurrencies = [
24 'AFN',
'ALL',
'AZN',
'DZD',
'AOA',
'ARS',
'AMD',
'AWG',
'AUD',
'BSD',
25 'BHD',
'BDT',
'BBD',
'BYR',
'BZD',
'BMD',
'BTN',
'BOB',
'BAM',
'BWP',
26 'BRL',
'GBP',
'BND',
'BGN',
'BUK',
'BIF',
'KHR',
'CAD',
'CVE',
'CZK',
27 'KYD',
'GQE',
'CLP',
'CNY',
'COP',
'KMF',
'CDF',
'CRC',
'HRK',
'CUP',
28 'DKK',
'DJF',
'DOP',
'XCD',
'EGP',
'SVC',
'ERN',
'EEK',
'ETB',
'EUR',
29 'FKP',
'FJD',
'GMD',
'GEK',
'GEL',
'GHS',
'GIP',
'GTQ',
'GNF',
'GYD',
30 'HTG',
'HNL',
'HKD',
'HUF',
'ISK',
'INR',
'IDR',
'IRR',
'IQD',
'ILS',
31 'JMD',
'JPY',
'JOD',
'KZT',
'KES',
'KWD',
'KGS',
'LAK',
'LVL',
'LBP',
32 'LSL',
'LRD',
'LYD',
'LTL',
'MOP',
'MKD',
'MGA',
'MWK',
'MYR',
'MVR',
33 'LSM',
'MRO',
'MUR',
'MXN',
'MDL',
'MNT',
'MAD',
'MZN',
'MMK',
'NAD',
34 'NPR',
'ANG',
'YTL',
'NZD',
'NIC',
'NGN',
'KPW',
'NOK',
'OMR',
'PKR',
35 'PAB',
'PGK',
'PYG',
'PEN',
'PHP',
'PLN',
'QAR',
'RHD',
'RON',
'RUB',
36 'RWF',
'SHP',
'STD',
'SAR',
'RSD',
'SCR',
'SLL',
'SGD',
'SKK',
'SBD',
37 'SOS',
'ZAR',
'KRW',
'LKR',
'SDG',
'SRD',
'SZL',
'SEK',
'CHF',
'SYP',
38 'TWD',
'TJS',
'TZS',
'THB',
'TOP',
'TTD',
'TND',
'TMM',
'USD',
'UGX',
39 'UAH',
'AED',
'UYU',
'UZS',
'VUV',
'VEB',
'VEF',
'VND',
'CHE',
'CHW',
40 'XOF',
'WST',
'YER',
'ZMK',
'ZWD',
'TRY',
'AZM',
'ROL',
'TRL',
'XPF',
43 private static $samplePresentLocales = [
44 'en_US',
'lv_LV',
'pt_BR',
'it_IT',
'ar_EG',
'bg_BG',
'en_IE',
'es_ES',
45 'en_AU',
'pt_PT',
'ru_RU',
'en_CA',
'vi_VN',
'ja_JP',
'en_GB',
'zh_CN',
46 'zh_TW',
'fr_FR',
'ar_KW',
'pl_PL',
'ko_KR',
'sk_SK',
'el_GR',
'hi_IN',
49 private static $sampleAbsentLocales = [
50 'aa_BB',
'foo_BAR',
'cc_DD',
53 private static $sampleAdditionalLocales = [
57 private static $samplePresentCurrencies = [
58 'AUD',
'BBD',
'GBP',
'CAD',
'CZK',
'GQE',
'CNY',
'DJF',
'HKD',
'JPY',
'MYR',
59 'MXN',
'NZD',
'PHP',
'SGD',
'CHF',
'TWD',
'USD',
'AED',
'ZWD',
'ROL',
'CHE',
62 private static $sampleAbsentCurrencies = [
63 'ABC',
'DEF',
'GHI',
'ZZZ',
66 private static $sampleAdditionalCurrencies = [
67 'QED',
'PNP',
'EJN',
'MTO',
'EBY',
71 private $configObject;
75 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
76 ->getObject(\
Magento\Framework\Locale\Config::class);
78 $retrievedLocales = $this->configObject->getAllowedLocales();
80 $differences = array_diff($this::$allAllowedLocales, $retrievedLocales);
82 $this->assertEmpty($differences);
84 foreach ($this::$sampleAbsentLocales as $absentLocale) {
85 $this->assertNotContains($absentLocale, $retrievedLocales);
91 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
93 \
Magento\Framework\Locale\Config::class,
96 'allowedLocales' => $this::$sampleAdditionalLocales,
101 $retrievedLocalesWithAdditions = $this->configObject->getAllowedLocales();
103 $differences = array_diff(
104 array_unique(array_merge($this::$allAllowedLocales, $this::$sampleAdditionalLocales)),
105 $retrievedLocalesWithAdditions
108 $this->assertEmpty($differences);
110 foreach ($this::$sampleAbsentLocales as $absentLocale) {
111 $this->assertNotContains($absentLocale, $retrievedLocalesWithAdditions);
117 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
119 \
Magento\Framework\Locale\Config::class,
122 'allowedLocales' => $this::$samplePresentLocales,
127 $retrievedLocalesWithRedundencies = $this->configObject->getAllowedLocales();
129 $differences = array_diff(
130 $this::$allAllowedLocales,
131 $retrievedLocalesWithRedundencies
134 $this->assertEmpty($differences);
136 foreach ($this::$sampleAbsentLocales as $absentLocale) {
137 $this->assertNotContains($absentLocale, $retrievedLocalesWithRedundencies);
143 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
144 ->getObject(\
Magento\Framework\Locale\Config::class);
146 $retrievedCurrencies = $this->configObject->getAllowedCurrencies();
148 $differences = array_diff($this::$allAllowedCurrencies, $retrievedCurrencies);
150 $this->assertEmpty($differences);
152 foreach ($this::$sampleAbsentCurrencies as $absentCurrency) {
153 $this->assertNotContains($absentCurrency, $retrievedCurrencies);
159 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
161 \
Magento\Framework\Locale\Config::class,
164 'allowedCurrencies' => $this::$sampleAdditionalCurrencies,
169 $retrievedCurrenciesWithAdditions = $this->configObject->getAllowedCurrencies();
171 $differences = array_diff(
172 array_unique(array_merge($this::$allAllowedCurrencies, $this::$samplePresentCurrencies)),
173 $retrievedCurrenciesWithAdditions
176 $this->assertEmpty($differences);
178 foreach ($this::$sampleAbsentCurrencies as $absentCurrency) {
179 $this->assertNotContains($absentCurrency, $retrievedCurrenciesWithAdditions);
185 $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
187 \
Magento\Framework\Locale\Config::class,
190 'allowedCurrencies' => $this::$samplePresentCurrencies,
195 $retrievedCurrenciesWithRedundencies = $this->configObject->getAllowedCurrencies();
197 $differences = array_diff(
198 $this::$allAllowedCurrencies,
199 $retrievedCurrenciesWithRedundencies
202 $this->assertEmpty($differences);
204 foreach ($this::$sampleAbsentCurrencies as $absentCurrency) {
205 $this->assertNotContains($absentCurrency, $retrievedCurrenciesWithRedundencies);
testGetAllowedCurrenciesGivenRedundantDataArray()
testGetAllowedCurrenciesNoDataArray()
testGetAllowedLocalesNoDataArray()
testGetAllowedCurrenciesGivenDataArray()
testGetAllowedLocalesGivenRedundantDataArray()
testGetAllowedLocalesGivenDataArray()