mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add retry counter meta to order to avoid duplicate invoice error on consequent tries
This commit is contained in:
parent
355bac28f9
commit
c072e8550a
6 changed files with 26 additions and 40 deletions
|
@ -42,7 +42,7 @@ class WcGatewayTest extends TestCase
|
|||
$orderId = 1;
|
||||
$wcOrder = Mockery::mock(\WC_Order::class);
|
||||
$wcOrder->shouldReceive('get_customer_id')->andReturn(1);
|
||||
|
||||
$wcOrder->shouldReceive('get_meta')->andReturn('');
|
||||
$settingsRenderer = Mockery::mock(SettingsRenderer::class);
|
||||
$orderProcessor = Mockery::mock(OrderProcessor::class);
|
||||
$orderProcessor
|
||||
|
@ -106,6 +106,18 @@ class WcGatewayTest extends TestCase
|
|||
when('wc_get_checkout_url')
|
||||
->justReturn('test');
|
||||
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
$session = Mockery::mock(\WC_Session::class);
|
||||
when('WC')->justReturn($woocommerce);
|
||||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('get')->andReturn([]);
|
||||
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
$cart = Mockery::mock(\WC_Cart::class);
|
||||
when('WC')->justReturn($woocommerce);
|
||||
$woocommerce->cart = $cart;
|
||||
$cart->shouldReceive('empty_cart');
|
||||
|
||||
$result = $testee->process_payment($orderId);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue