Fix phpunit

This commit is contained in:
dinamiko 2022-10-21 12:25:22 +02:00
parent 5f299b2939
commit f66c2322fd
4 changed files with 8 additions and 2 deletions

View file

@ -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')

View file

@ -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,

View file

@ -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);