mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Fix phpunit
This commit is contained in:
parent
14d102015d
commit
c39b03bcc9
2 changed files with 21 additions and 0 deletions
|
@ -147,9 +147,11 @@ class WcGatewayTest extends TestCase
|
|||
when('WC')->justReturn($woocommerce);
|
||||
$woocommerce->cart = $cart;
|
||||
$cart->shouldReceive('empty_cart');
|
||||
|
||||
$session = Mockery::mock(\WC_Session::class);
|
||||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('get');
|
||||
$session->shouldReceive('set');
|
||||
|
||||
$result = $testee->process_payment($orderId);
|
||||
|
||||
|
@ -164,6 +166,12 @@ class WcGatewayTest extends TestCase
|
|||
|
||||
$testee = $this->createGateway();
|
||||
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
$session = Mockery::mock(\WC_Session::class);
|
||||
when('WC')->justReturn($woocommerce);
|
||||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('set')->andReturn([]);
|
||||
|
||||
expect('wc_get_order')
|
||||
->with($orderId)
|
||||
->andReturn(false);
|
||||
|
@ -227,6 +235,7 @@ class WcGatewayTest extends TestCase
|
|||
$session = Mockery::mock(\WC_Session::class);
|
||||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('get');
|
||||
$session->shouldReceive('set');
|
||||
|
||||
$result = $testee->process_payment($orderId);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue