mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Fix phpunit
Some checks failed
CI / PHP 7.4 (push) Has been cancelled
CI / PHP 8.0 (push) Has been cancelled
CI / PHP 8.1 (push) Has been cancelled
CI / PHP 8.2 (push) Has been cancelled
CI / PHP 8.3 (push) Has been cancelled
CI / PHP 8.4 (push) Has been cancelled
PR Playground Demo / prepare_version (push) Has been cancelled
PR Playground Demo / build_plugin (push) Has been cancelled
PR Playground Demo / create_archive (push) Has been cancelled
PR Playground Demo / Comment on PR with Playground details (push) Has been cancelled
Some checks failed
CI / PHP 7.4 (push) Has been cancelled
CI / PHP 8.0 (push) Has been cancelled
CI / PHP 8.1 (push) Has been cancelled
CI / PHP 8.2 (push) Has been cancelled
CI / PHP 8.3 (push) Has been cancelled
CI / PHP 8.4 (push) Has been cancelled
PR Playground Demo / prepare_version (push) Has been cancelled
PR Playground Demo / build_plugin (push) Has been cancelled
PR Playground Demo / create_archive (push) Has been cancelled
PR Playground Demo / Comment on PR with Playground details (push) Has been cancelled
This commit is contained in:
parent
d84a7dd5bb
commit
63426a67f3
1 changed files with 12 additions and 0 deletions
|
@ -84,6 +84,18 @@ class ChangeCartEndpointTest extends TestCase
|
|||
->with(ChangeCartEndpoint::nonce())
|
||||
->andReturn($data);
|
||||
|
||||
// Mock WC session for shipping data preservation
|
||||
$session = Mockery::mock(\WC_Session::class);
|
||||
$session->shouldReceive('get')
|
||||
->with('chosen_shipping_methods')
|
||||
->andReturn(null);
|
||||
$session->shouldReceive('set')
|
||||
->with('chosen_shipping_methods', Mockery::any());
|
||||
|
||||
$wc = Mockery::mock();
|
||||
$wc->session = $session;
|
||||
expect('WC')->andReturn($wc);
|
||||
|
||||
$pu = Mockery::mock(PurchaseUnit::class);
|
||||
$pu
|
||||
->shouldReceive('to_array')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue