diff --git a/tests/PHPUnit/Vaulting/VaultedCreditCardHandlerTest.php b/tests/PHPUnit/Vaulting/VaultedCreditCardHandlerTest.php index fca3bf453..f158872e7 100644 --- a/tests/PHPUnit/Vaulting/VaultedCreditCardHandlerTest.php +++ b/tests/PHPUnit/Vaulting/VaultedCreditCardHandlerTest.php @@ -24,8 +24,6 @@ use WooCommerce\PayPalCommerce\TestCase; use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository; use WooCommerce\PayPalCommerce\Vaulting\VaultedCreditCardHandler; use WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor; -use function Brain\Monkey\Functions\expect; -use function Brain\Monkey\Functions\when; class VaultedCreditCardHandlerTest extends TestCase { @@ -123,6 +121,7 @@ class VaultedCreditCardHandlerTest extends TestCase $capture->shouldReceive('status')->andReturn($captureStatus); $payments->shouldReceive('captures')->andReturn([$capture]); $purchaseUnit->shouldReceive('payments')->andReturn($payments); + $purchaseUnit->shouldReceive('shipping')->andReturn(null); $this->orderEndpoint->shouldReceive('create') ->with([$purchaseUnit], 'some_preference', $payer, '', array(), $requestPaymentSource) diff --git a/tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php b/tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php index 0a8a5d8f6..baf600cf0 100644 --- a/tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php +++ b/tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php @@ -9,7 +9,6 @@ use WC_Order; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\ExperienceContext; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; -use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentSource; use WooCommerce\PayPalCommerce\ApiClient\Entity\PurchaseUnit; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; use WooCommerce\PayPalCommerce\ApiClient\Factory\ExperienceContextBuilder; @@ -111,6 +110,7 @@ private $testee; $order->shouldReceive('intent'); $order->shouldReceive('payment_source'); $order->shouldReceive('payer'); + $order->shouldReceive('purchase_units')->andReturn([]); $this->orderEndpoint ->shouldReceive('create') diff --git a/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php b/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php index 6f5862e81..89925b230 100644 --- a/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php +++ b/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php @@ -23,13 +23,11 @@ use WooCommerce\PayPalCommerce\ApiClient\Helper\OrderHelper; use WooCommerce\PayPalCommerce\Button\Helper\ThreeDSecure; use WooCommerce\PayPalCommerce\WcGateway\Helper\Environment; use WooCommerce\PayPalCommerce\Session\SessionHandler; -use WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer; use WooCommerce\PayPalCommerce\WcSubscriptions\Helper\SubscriptionHelper; use WooCommerce\PayPalCommerce\TestCase; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; use Mockery; -use function Brain\Monkey\Functions\when; class OrderProcessorTest extends TestCase { @@ -59,6 +57,8 @@ class OrderProcessorTest extends TestCase $purchaseUnit = Mockery::mock(PurchaseUnit::class); $purchaseUnit->shouldReceive('payments') ->andReturn($payments); + $purchaseUnit->shouldReceive('shipping') + ->andReturn(null); $wcOrder = Mockery::mock(\WC_Order::class); $wcOrder->expects('get_items')->andReturn([]); @@ -213,6 +213,8 @@ class OrderProcessorTest extends TestCase $purchaseUnit = Mockery::mock(PurchaseUnit::class); $purchaseUnit->shouldReceive('payments') ->andReturn($payments); + $purchaseUnit->shouldReceive('shipping') + ->andReturn(null); $wcOrder = Mockery::mock(\WC_Order::class); $wcOrder->expects('get_items')->andReturn([]); @@ -348,7 +350,9 @@ class OrderProcessorTest extends TestCase $purchaseUnit = Mockery::mock(PurchaseUnit::class); $purchaseUnit->shouldReceive('payments') - ->andReturn($payments); + ->andReturn($payments);; + $purchaseUnit->shouldReceive('shipping') + ->andReturn(null); $wcOrder = Mockery::mock(\WC_Order::class);