mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Fix the tests
This commit is contained in:
parent
2dcf3279b8
commit
3ab7fe0af3
4 changed files with 286 additions and 244 deletions
510
composer.lock
generated
510
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
17
tests/stubs/DefaultPaymentGateways.php
Normal file
17
tests/stubs/DefaultPaymentGateways.php
Normal 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'];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue