Fix unit tests

This commit is contained in:
dinamiko 2022-04-22 15:26:44 +02:00
parent cf0d7858fd
commit 56f12ed853
2 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,7 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Gateway\PayUponInvoice;
use Mockery;
use Psr\Log\LoggerInterface;
use WC_Order;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PayUponInvoiceOrderEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PurchaseUnit;
use WooCommerce\PayPalCommerce\ApiClient\Factory\PurchaseUnitFactory;

View file

@ -47,6 +47,7 @@ class WcGatewayTest extends TestCase
private $logger;
private $paymentsEndpoint;
private $orderEndpoint;
private $apiShopCountry;
public function setUp(): void {
parent::setUp();
@ -70,6 +71,7 @@ class WcGatewayTest extends TestCase
$this->paymentsEndpoint = Mockery::mock(PaymentsEndpoint::class);
$this->orderEndpoint = Mockery::mock(OrderEndpoint::class);
$this->funding_source_renderer = new FundingSourceRenderer($this->settings);
$this->apiShopCountry = 'DE';
$this->onboardingState->shouldReceive('current_state')->andReturn(State::STATE_ONBOARDED);
@ -102,7 +104,8 @@ class WcGatewayTest extends TestCase
$this->paymentTokenRepository,
$this->logger,
$this->paymentsEndpoint,
$this->orderEndpoint
$this->orderEndpoint,
$this->apiShopCountry
);
}
@ -135,7 +138,6 @@ class WcGatewayTest extends TestCase
->with($orderId)
->andReturn($wcOrder);
when('wc_get_checkout_url')
->justReturn('test');