mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Merge pull request #922 from woocommerce/PCP-937-php-8.1-support
PHP 8.1 support
This commit is contained in:
commit
8bc53bf3cf
18 changed files with 76 additions and 55 deletions
|
@ -70,7 +70,7 @@ class VaultedCreditCardHandlerTest extends TestCase
|
|||
|
||||
public function testHandlePaymentChangingPayment()
|
||||
{
|
||||
when('filter_input')->justReturn(1);
|
||||
$_POST['woocommerce_change_payment'] = 1;
|
||||
$wcOrder = Mockery::mock(\WC_Order::class);
|
||||
$wcOrder->shouldReceive('get_id')->andReturn(1);
|
||||
$wcOrder->shouldReceive('update_meta_data')
|
||||
|
@ -88,6 +88,8 @@ class VaultedCreditCardHandlerTest extends TestCase
|
|||
|
||||
public function testHandlePayment()
|
||||
{
|
||||
$_POST['woocommerce_change_payment'] = null;
|
||||
|
||||
$wcOrder = Mockery::mock(\WC_Order::class);
|
||||
$wcOrder->shouldReceive('get_id')->andReturn(1);
|
||||
$wcOrder->shouldReceive('get_customer_id')->andReturn(1);
|
||||
|
|
|
@ -55,6 +55,8 @@ class CreditCardGatewayTest extends TestCase
|
|||
$this->config->shouldReceive('has')->andReturn(true);
|
||||
$this->config->shouldReceive('get')->andReturn('');
|
||||
|
||||
when('wc_clean')->returnArg();
|
||||
|
||||
$this->testee = new CreditCardGateway(
|
||||
$this->settingsRenderer,
|
||||
$this->orderProcessor,
|
||||
|
@ -94,7 +96,7 @@ class CreditCardGatewayTest extends TestCase
|
|||
when('wc_get_order')->justReturn($wc_order);
|
||||
|
||||
$savedCreditCard = 'abc123';
|
||||
when('filter_input')->justReturn($savedCreditCard);
|
||||
$_POST['saved_credit_card'] = $savedCreditCard;
|
||||
|
||||
$this->vaultedCreditCardHandler
|
||||
->shouldReceive('handle_payment')
|
||||
|
|
|
@ -43,6 +43,7 @@ class PayUponInvoiceGatewayTest extends TestCase
|
|||
$this->checkout_helper = Mockery::mock(CheckoutHelper::class);
|
||||
|
||||
$this->setInitStubs();
|
||||
when('wc_clean')->returnArg();
|
||||
|
||||
$this->testee = new PayUponInvoiceGateway(
|
||||
$this->order_endpoint,
|
||||
|
|
|
@ -46,6 +46,7 @@ class WcGatewayTest extends TestCase
|
|||
expect('is_admin')->andReturnUsing(function () {
|
||||
return $this->isAdmin;
|
||||
});
|
||||
when('wc_clean')->returnArg();
|
||||
|
||||
$this->settingsRenderer = Mockery::mock(SettingsRenderer::class);
|
||||
$this->orderProcessor = Mockery::mock(OrderProcessor::class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue