Skip to content

Commit

Permalink
more constants and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timur27 committed Nov 8, 2024
1 parent 4ae3dbb commit a1921e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/constants/class-country-test-cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ class Country_Test_Cards extends Base_Constant {
* @return string Test card number
*/
public static function get_test_card_for_country( string $country_code ) {
return self::$country_test_cards[ $country_code ] ?? self::$country_test_cards['US'];
return self::$country_test_cards[ $country_code ] ?? self::$country_test_cards[ Country_Code::UNITED_STATES ];
}
}
6 changes: 5 additions & 1 deletion tests/unit/test-class-wc-payments-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* @package WooCommerce\Payments\Tests
*/
class WC_Payments_Checkout_Test extends WP_UnitTestCase {
class Timur_Test extends WP_UnitTestCase {

/**
* Holds the object, which will be tested.
Expand Down Expand Up @@ -404,6 +404,10 @@ public function test_link_payment_method_provided_when_card_enabled() {
* @dataProvider non_reusable_payment_method_provider
*/
public function test_no_save_option_for_non_reusable_payment_method( $payment_method_id, $payment_method_class ) {
$this->mock_wcpay_account
->method( 'get_account_country' )
->willReturn( 'US' );

$this->mock_wcpay_gateway
->expects( $this->any() )
->method( 'get_payment_method_ids_enabled_at_checkout' )
Expand Down

0 comments on commit a1921e8

Please sign in to comment.