Skip to content

Commit 0942465

Browse files
committed
Added tests
1 parent 69058e8 commit 0942465

File tree

1 file changed

+232
-0
lines changed

1 file changed

+232
-0
lines changed
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
<?php
2+
/**
3+
* Class Country_Code_Test
4+
*
5+
* @package WooCommerce\Payments\Tests
6+
*/
7+
8+
use WCPay\Constants\Country_Code;
9+
10+
/**
11+
* Country_Code_Test unit tests.
12+
*/
13+
class Country_Code_Test extends WCPAY_UnitTestCase {
14+
15+
public function test_africa_country_codes() {
16+
$this->assertSame( 'DZ', Country_Code::ALGERIA );
17+
$this->assertSame( 'AO', Country_Code::ANGOLA );
18+
$this->assertSame( 'BJ', Country_Code::BENIN );
19+
$this->assertSame( 'BW', Country_Code::BOTSWANA );
20+
$this->assertSame( 'BF', Country_Code::BURKINA_FASO );
21+
$this->assertSame( 'BI', Country_Code::BURUNDI );
22+
$this->assertSame( 'CV', Country_Code::CABO_VERDE );
23+
$this->assertSame( 'CM', Country_Code::CAMEROON );
24+
$this->assertSame( 'CF', Country_Code::CENTRAL_AFRICAN_REPUBLIC );
25+
$this->assertSame( 'TD', Country_Code::CHAD );
26+
$this->assertSame( 'KM', Country_Code::COMOROS );
27+
$this->assertSame( 'CG', Country_Code::CONGO );
28+
$this->assertSame( 'CI', Country_Code::IVORY_COAST );
29+
$this->assertSame( 'DJ', Country_Code::DJIBOUTI );
30+
$this->assertSame( 'EG', Country_Code::EGYPT );
31+
$this->assertSame( 'GQ', Country_Code::EQUATORIAL_GUINEA );
32+
$this->assertSame( 'ER', Country_Code::ERITREA );
33+
$this->assertSame( 'SZ', Country_Code::ESWATINI );
34+
$this->assertSame( 'ET', Country_Code::ETHIOPIA );
35+
$this->assertSame( 'GA', Country_Code::GABON );
36+
$this->assertSame( 'GM', Country_Code::GAMBIA );
37+
$this->assertSame( 'GH', Country_Code::GHANA );
38+
$this->assertSame( 'GN', Country_Code::GUINEA );
39+
$this->assertSame( 'GW', Country_Code::GUINEA_BISSAU );
40+
$this->assertSame( 'KE', Country_Code::KENYA );
41+
$this->assertSame( 'LS', Country_Code::LESOTHO );
42+
$this->assertSame( 'LR', Country_Code::LIBERIA );
43+
$this->assertSame( 'LY', Country_Code::LIBYA );
44+
$this->assertSame( 'MG', Country_Code::MADAGASCAR );
45+
$this->assertSame( 'MW', Country_Code::MALAWI );
46+
$this->assertSame( 'ML', Country_Code::MALI );
47+
$this->assertSame( 'MR', Country_Code::MAURITANIA );
48+
$this->assertSame( 'MU', Country_Code::MAURITIUS );
49+
$this->assertSame( 'MA', Country_Code::MOROCCO );
50+
$this->assertSame( 'MZ', Country_Code::MOZAMBIQUE );
51+
$this->assertSame( 'NA', Country_Code::NAMIBIA );
52+
$this->assertSame( 'NE', Country_Code::NIGER );
53+
$this->assertSame( 'NG', Country_Code::NIGERIA );
54+
$this->assertSame( 'RW', Country_Code::RWANDA );
55+
$this->assertSame( 'ST', Country_Code::SAO_TOME_AND_PRINCIPE );
56+
$this->assertSame( 'SN', Country_Code::SENEGAL );
57+
$this->assertSame( 'SC', Country_Code::SEYCHELLES );
58+
$this->assertSame( 'SL', Country_Code::SIERRA_LEONE );
59+
$this->assertSame( 'SO', Country_Code::SOMALIA );
60+
$this->assertSame( 'ZA', Country_Code::SOUTH_AFRICA );
61+
$this->assertSame( 'SS', Country_Code::SOUTH_SUDAN );
62+
$this->assertSame( 'SD', Country_Code::SUDAN );
63+
$this->assertSame( 'TZ', Country_Code::TANZANIA );
64+
$this->assertSame( 'TG', Country_Code::TOGO );
65+
$this->assertSame( 'TN', Country_Code::TUNISIA );
66+
$this->assertSame( 'UG', Country_Code::UGANDA );
67+
$this->assertSame( 'ZM', Country_Code::ZAMBIA );
68+
$this->assertSame( 'ZW', Country_Code::ZIMBABWE );
69+
}
70+
71+
public function test_europe_country_codes() {
72+
$this->assertSame( 'AL', Country_Code::ALBANIA );
73+
$this->assertSame( 'AD', Country_Code::ANDORRA );
74+
$this->assertSame( 'AT', Country_Code::AUSTRIA );
75+
$this->assertSame( 'BY', Country_Code::BELARUS );
76+
$this->assertSame( 'BE', Country_Code::BELGIUM );
77+
$this->assertSame( 'BA', Country_Code::BOSNIA_AND_HERZEGOVINA );
78+
$this->assertSame( 'BG', Country_Code::BULGARIA );
79+
$this->assertSame( 'HR', Country_Code::CROATIA );
80+
$this->assertSame( 'CY', Country_Code::CYPRUS );
81+
$this->assertSame( 'CZ', Country_Code::CZECHIA );
82+
$this->assertSame( 'DK', Country_Code::DENMARK );
83+
$this->assertSame( 'EE', Country_Code::ESTONIA );
84+
$this->assertSame( 'FI', Country_Code::FINLAND );
85+
$this->assertSame( 'FR', Country_Code::FRANCE );
86+
$this->assertSame( 'GE', Country_Code::GEORGIA );
87+
$this->assertSame( 'DE', Country_Code::GERMANY );
88+
$this->assertSame( 'GR', Country_Code::GREECE );
89+
$this->assertSame( 'HU', Country_Code::HUNGARY );
90+
$this->assertSame( 'IS', Country_Code::ICELAND );
91+
$this->assertSame( 'IE', Country_Code::IRELAND );
92+
$this->assertSame( 'IT', Country_Code::ITALY );
93+
$this->assertSame( 'XK', Country_Code::KOSOVO );
94+
$this->assertSame( 'LV', Country_Code::LATVIA );
95+
$this->assertSame( 'LI', Country_Code::LIECHTENSTEIN );
96+
$this->assertSame( 'LT', Country_Code::LITHUANIA );
97+
$this->assertSame( 'LU', Country_Code::LUXEMBOURG );
98+
$this->assertSame( 'MT', Country_Code::MALTA );
99+
$this->assertSame( 'MD', Country_Code::MOLDOVA );
100+
$this->assertSame( 'MC', Country_Code::MONACO );
101+
$this->assertSame( 'ME', Country_Code::MONTENEGRO );
102+
$this->assertSame( 'NL', Country_Code::NETHERLANDS );
103+
$this->assertSame( 'MK', Country_Code::NORTH_MACEDONIA );
104+
$this->assertSame( 'NO', Country_Code::NORWAY );
105+
$this->assertSame( 'PL', Country_Code::POLAND );
106+
$this->assertSame( 'PT', Country_Code::PORTUGAL );
107+
$this->assertSame( 'RO', Country_Code::ROMANIA );
108+
$this->assertSame( 'RU', Country_Code::RUSSIA );
109+
$this->assertSame( 'SM', Country_Code::SAN_MARINO );
110+
$this->assertSame( 'RS', Country_Code::SERBIA );
111+
$this->assertSame( 'SK', Country_Code::SLOVAKIA );
112+
$this->assertSame( 'SI', Country_Code::SLOVENIA );
113+
$this->assertSame( 'ES', Country_Code::SPAIN );
114+
$this->assertSame( 'SE', Country_Code::SWEDEN );
115+
$this->assertSame( 'CH', Country_Code::SWITZERLAND );
116+
$this->assertSame( 'UA', Country_Code::UKRAINE );
117+
$this->assertSame( 'GB', Country_Code::UNITED_KINGDOM );
118+
$this->assertSame( 'VA', Country_Code::VATICAN_CITY );
119+
}
120+
121+
public function test_asia_country_codes() {
122+
$this->assertSame( 'AF', Country_Code::AFGHANISTAN );
123+
$this->assertSame( 'AM', Country_Code::ARMENIA );
124+
$this->assertSame( 'AZ', Country_Code::AZERBAIJAN );
125+
$this->assertSame( 'BH', Country_Code::BAHRAIN );
126+
$this->assertSame( 'BD', Country_Code::BANGLADESH );
127+
$this->assertSame( 'BT', Country_Code::BHUTAN );
128+
$this->assertSame( 'BN', Country_Code::BRUNEI );
129+
$this->assertSame( 'KH', Country_Code::CAMBODIA );
130+
$this->assertSame( 'CN', Country_Code::CHINA );
131+
$this->assertSame( 'GE', Country_Code::GEORGIA );
132+
$this->assertSame( 'IN', Country_Code::INDIA );
133+
$this->assertSame( 'ID', Country_Code::INDONESIA );
134+
$this->assertSame( 'IR', Country_Code::IRAN );
135+
$this->assertSame( 'IQ', Country_Code::IRAQ );
136+
$this->assertSame( 'IL', Country_Code::ISRAEL );
137+
$this->assertSame( 'JP', Country_Code::JAPAN );
138+
$this->assertSame( 'JO', Country_Code::JORDAN );
139+
$this->assertSame( 'KZ', Country_Code::KAZAKHSTAN );
140+
$this->assertSame( 'KW', Country_Code::KUWAIT );
141+
$this->assertSame( 'KG', Country_Code::KYRGYZSTAN );
142+
$this->assertSame( 'LA', Country_Code::LAOS );
143+
$this->assertSame( 'LB', Country_Code::LEBANON );
144+
$this->assertSame( 'MY', Country_Code::MALAYSIA );
145+
$this->assertSame( 'MV', Country_Code::MALDIVES );
146+
$this->assertSame( 'MN', Country_Code::MONGOLIA );
147+
$this->assertSame( 'MM', Country_Code::MYANMAR );
148+
$this->assertSame( 'NP', Country_Code::NEPAL );
149+
$this->assertSame( 'KP', Country_Code::NORTH_KOREA );
150+
$this->assertSame( 'OM', Country_Code::OMAN );
151+
$this->assertSame( 'PK', Country_Code::PAKISTAN );
152+
$this->assertSame( 'PS', Country_Code::PALESTINE );
153+
$this->assertSame( 'PH', Country_Code::PHILIPPINES );
154+
$this->assertSame( 'QA', Country_Code::QATAR );
155+
$this->assertSame( 'SA', Country_Code::SAUDI_ARABIA );
156+
$this->assertSame( 'SG', Country_Code::SINGAPORE );
157+
$this->assertSame( 'KR', Country_Code::SOUTH_KOREA );
158+
$this->assertSame( 'SY', Country_Code::SYRIA );
159+
$this->assertSame( 'TW', Country_Code::TAIWAN );
160+
$this->assertSame( 'TJ', Country_Code::TAJIKISTAN );
161+
$this->assertSame( 'TH', Country_Code::THAILAND );
162+
$this->assertSame( 'TR', Country_Code::TURKEY );
163+
$this->assertSame( 'TM', Country_Code::TURKMENISTAN );
164+
$this->assertSame( 'AE', Country_Code::UNITED_ARAB_EMIRATES );
165+
$this->assertSame( 'UZ', Country_Code::UZBEKISTAN );
166+
$this->assertSame( 'VN', Country_Code::VIETNAM );
167+
$this->assertSame( 'YE', Country_Code::YEMEN );
168+
}
169+
170+
public function test_north_america_country_codes() {
171+
$this->assertSame( 'BS', Country_Code::BAHAMAS );
172+
$this->assertSame( 'BB', Country_Code::BARBADOS );
173+
$this->assertSame( 'BZ', Country_Code::BELIZE );
174+
$this->assertSame( 'BM', Country_Code::BERMUDA );
175+
$this->assertSame( 'CA', Country_Code::CANADA );
176+
$this->assertSame( 'CR', Country_Code::COSTA_RICA );
177+
$this->assertSame( 'CU', Country_Code::CUBA );
178+
$this->assertSame( 'DM', Country_Code::DOMINICA );
179+
$this->assertSame( 'DO', Country_Code::DOMINICAN_REPUBLIC );
180+
$this->assertSame( 'SV', Country_Code::EL_SALVADOR );
181+
$this->assertSame( 'GD', Country_Code::GRENADA );
182+
$this->assertSame( 'GT', Country_Code::GUATEMALA );
183+
$this->assertSame( 'HT', Country_Code::HAITI );
184+
$this->assertSame( 'HN', Country_Code::HONDURAS );
185+
$this->assertSame( 'JM', Country_Code::JAMAICA );
186+
$this->assertSame( 'MX', Country_Code::MEXICO );
187+
$this->assertSame( 'NI', Country_Code::NICARAGUA );
188+
$this->assertSame( 'PA', Country_Code::PANAMA );
189+
$this->assertSame( 'KN', Country_Code::SAINT_KITTS_AND_NEVIS );
190+
$this->assertSame( 'LC', Country_Code::SAINT_LUCIA );
191+
$this->assertSame( 'VC', Country_Code::SAINT_VINCENT_AND_THE_GRENADINES );
192+
$this->assertSame( 'TT', Country_Code::TRINIDAD_AND_TOBAGO );
193+
$this->assertSame( 'US', Country_Code::UNITED_STATES );
194+
}
195+
196+
public function test_south_america_country_codes() {
197+
$this->assertSame( 'AR', Country_Code::ARGENTINA );
198+
$this->assertSame( 'BO', Country_Code::BOLIVIA );
199+
$this->assertSame( 'BR', Country_Code::BRAZIL );
200+
$this->assertSame( 'CL', Country_Code::CHILE );
201+
$this->assertSame( 'CO', Country_Code::COLOMBIA );
202+
$this->assertSame( 'EC', Country_Code::ECUADOR );
203+
$this->assertSame( 'GY', Country_Code::GUYANA );
204+
$this->assertSame( 'PY', Country_Code::PARAGUAY );
205+
$this->assertSame( 'PE', Country_Code::PERU );
206+
$this->assertSame( 'SR', Country_Code::SURINAME );
207+
$this->assertSame( 'UY', Country_Code::URUGUAY );
208+
$this->assertSame( 'VE', Country_Code::VENEZUELA );
209+
}
210+
211+
public function test_oceania_country_codes() {
212+
$this->assertSame( 'AU', Country_Code::AUSTRALIA );
213+
$this->assertSame( 'CK', Country_Code::COOK_ISLANDS );
214+
$this->assertSame( 'FJ', Country_Code::FIJI );
215+
$this->assertSame( 'KI', Country_Code::KIRIBATI );
216+
$this->assertSame( 'MH', Country_Code::MARSHALL_ISLANDS );
217+
$this->assertSame( 'FM', Country_Code::MICRONESIA );
218+
$this->assertSame( 'NR', Country_Code::NAURU );
219+
$this->assertSame( 'NZ', Country_Code::NEW_ZEALAND );
220+
$this->assertSame( 'PW', Country_Code::PALAU );
221+
$this->assertSame( 'PG', Country_Code::PAPUA_NEW_GUINEA );
222+
$this->assertSame( 'WS', Country_Code::SAMOA );
223+
$this->assertSame( 'SB', Country_Code::SOLOMON_ISLANDS );
224+
$this->assertSame( 'TO', Country_Code::TONGA );
225+
$this->assertSame( 'TV', Country_Code::TUVALU );
226+
$this->assertSame( 'VU', Country_Code::VANUATU );
227+
}
228+
229+
public function test_antarctica_country_codes() {
230+
$this->assertSame( 'AQ', Country_Code::ANTARCTICA );
231+
}
232+
}

0 commit comments

Comments
 (0)