File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1122,6 +1122,35 @@ public function test_is_store_api_request_with_url_with_no_path() {
1122
1122
$ this ->assertFalse ( WC_Payments_Utils::is_store_api_request () );
1123
1123
}
1124
1124
1125
+ public function test_is_any_bnpl_supporting_country () {
1126
+ // Test supported country and currency combination (US with USD).
1127
+ $ this ->assertTrue (
1128
+ WC_Payments_Utils::is_any_bnpl_supporting_country (
1129
+ [ 'afterpay_clearpay ' , 'klarna ' ],
1130
+ 'US ' ,
1131
+ 'USD '
1132
+ )
1133
+ );
1134
+
1135
+ // Test unsupported country and currency combination.
1136
+ $ this ->assertFalse (
1137
+ WC_Payments_Utils::is_any_bnpl_supporting_country (
1138
+ [ 'afterpay_clearpay ' , 'klarna ' ],
1139
+ 'CN ' ,
1140
+ 'CNY '
1141
+ )
1142
+ );
1143
+
1144
+ // Test with empty enabled methods.
1145
+ $ this ->assertFalse (
1146
+ WC_Payments_Utils::is_any_bnpl_supporting_country (
1147
+ [],
1148
+ 'US ' ,
1149
+ 'USD '
1150
+ )
1151
+ );
1152
+ }
1153
+
1125
1154
public function test_is_any_bnpl_method_available () {
1126
1155
// Price within range for Afterpay/Clearpay in the US.
1127
1156
$ this ->assertTrue (
You can’t perform that action at this time.
0 commit comments