Fix the tests

This commit is contained in:
Narek Zakarian 2025-06-27 12:56:12 +04:00
parent 2dcf3279b8
commit 3ab7fe0af3
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
4 changed files with 286 additions and 244 deletions

510
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -32,6 +32,8 @@ class ModularTestCase extends TestCase
when('WC')->justReturn((object) [
'session' => null,
]);
when('is_admin')->justReturn(true);
when('sanitize_key')->returnArg();
global $wpdb;
$wpdb = \Mockery::mock(\stdClass::class);

View file

@ -11,5 +11,6 @@ require_once TESTS_ROOT_DIR . '/stubs/WC_Payment_Gateway_CC.php';
require_once TESTS_ROOT_DIR . '/stubs/WC_Ajax.php';
require_once TESTS_ROOT_DIR . '/stubs/WC_Checkout.php';
require_once TESTS_ROOT_DIR . '/stubs/Task.php';
require_once TESTS_ROOT_DIR . '/stubs/DefaultPaymentGateways.php';
Hamcrest\Util::registerGlobalFunctions();

View file

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions;
class DefaultPaymentGateways
{
public static function get_all(): array
{
return [];
}
public static function get_wcpay_countries(): array
{
return ['US', 'CA', 'GB', 'AU', 'DE', 'FR'];
}
}