mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
fix tests
This commit is contained in:
parent
607a247133
commit
7d490c6b7c
2 changed files with 29 additions and 4 deletions
|
@ -160,6 +160,10 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
||||||
->shouldReceive('is')
|
->shouldReceive('is')
|
||||||
->with(AuthorizationStatus::CREATED)
|
->with(AuthorizationStatus::CREATED)
|
||||||
->andReturn(false);
|
->andReturn(false);
|
||||||
|
$authorizationStatus
|
||||||
|
->shouldReceive('is')
|
||||||
|
->with(AuthorizationStatus::PENDING)
|
||||||
|
->andReturn(false);
|
||||||
$authorization = Mockery::mock(Authorization::class);
|
$authorization = Mockery::mock(Authorization::class);
|
||||||
$authorization
|
$authorization
|
||||||
->shouldReceive('id')
|
->shouldReceive('id')
|
||||||
|
|
|
@ -14,6 +14,7 @@ use Inpsyde\PayPalCommerce\Button\Helper\ThreeDSecure;
|
||||||
use Inpsyde\PayPalCommerce\Session\SessionHandler;
|
use Inpsyde\PayPalCommerce\Session\SessionHandler;
|
||||||
use Inpsyde\PayPalCommerce\TestCase;
|
use Inpsyde\PayPalCommerce\TestCase;
|
||||||
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
use Inpsyde\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||||
|
use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
|
||||||
use Inpsyde\Woocommerce\Logging\WoocommerceLoggingModule;
|
use Inpsyde\Woocommerce\Logging\WoocommerceLoggingModule;
|
||||||
use Mockery;
|
use Mockery;
|
||||||
|
|
||||||
|
@ -66,6 +67,11 @@ class OrderProcessorTest extends TestCase
|
||||||
->with($wcOrder, $currentOrder)
|
->with($wcOrder, $currentOrder)
|
||||||
->andReturn($currentOrder);
|
->andReturn($currentOrder);
|
||||||
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
||||||
|
$authorizedPaymentProcessor = Mockery::mock(AuthorizedPaymentsProcessor::class);
|
||||||
|
$settings = Mockery::mock(Settings::class);
|
||||||
|
$settings
|
||||||
|
->shouldReceive('has')
|
||||||
|
->andReturnFalse();
|
||||||
|
|
||||||
$testee = new OrderProcessor(
|
$testee = new OrderProcessor(
|
||||||
$sessionHandler,
|
$sessionHandler,
|
||||||
|
@ -73,7 +79,9 @@ class OrderProcessorTest extends TestCase
|
||||||
$orderEndpoint,
|
$orderEndpoint,
|
||||||
$paymentsEndpoint,
|
$paymentsEndpoint,
|
||||||
$orderFactory,
|
$orderFactory,
|
||||||
$threeDSecure
|
$threeDSecure,
|
||||||
|
$authorizedPaymentProcessor,
|
||||||
|
$settings
|
||||||
);
|
);
|
||||||
|
|
||||||
$cart = Mockery::mock(\WC_Cart::class);
|
$cart = Mockery::mock(\WC_Cart::class);
|
||||||
|
@ -152,6 +160,11 @@ class OrderProcessorTest extends TestCase
|
||||||
->with($wcOrder, $currentOrder)
|
->with($wcOrder, $currentOrder)
|
||||||
->andReturn($currentOrder);
|
->andReturn($currentOrder);
|
||||||
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
||||||
|
$authorizedPaymentProcessor = Mockery::mock(AuthorizedPaymentsProcessor::class);
|
||||||
|
$settings = Mockery::mock(Settings::class);
|
||||||
|
$settings
|
||||||
|
->shouldReceive('has')
|
||||||
|
->andReturnFalse();
|
||||||
|
|
||||||
$testee = new OrderProcessor(
|
$testee = new OrderProcessor(
|
||||||
$sessionHandler,
|
$sessionHandler,
|
||||||
|
@ -159,7 +172,9 @@ class OrderProcessorTest extends TestCase
|
||||||
$orderEndpoint,
|
$orderEndpoint,
|
||||||
$paymentsEndpoint,
|
$paymentsEndpoint,
|
||||||
$orderFactory,
|
$orderFactory,
|
||||||
$threeDSecure
|
$threeDSecure,
|
||||||
|
$authorizedPaymentProcessor,
|
||||||
|
$settings
|
||||||
);
|
);
|
||||||
|
|
||||||
$cart = Mockery::mock(\WC_Cart::class);
|
$cart = Mockery::mock(\WC_Cart::class);
|
||||||
|
@ -208,6 +223,9 @@ class OrderProcessorTest extends TestCase
|
||||||
$currentOrder
|
$currentOrder
|
||||||
->shouldReceive('status')
|
->shouldReceive('status')
|
||||||
->andReturn($orderStatus);
|
->andReturn($orderStatus);
|
||||||
|
$currentOrder
|
||||||
|
->shouldReceive('paymentSource')
|
||||||
|
->andReturnNull();
|
||||||
$sessionHandler = Mockery::mock(SessionHandler::class);
|
$sessionHandler = Mockery::mock(SessionHandler::class);
|
||||||
$sessionHandler
|
$sessionHandler
|
||||||
->expects('order')
|
->expects('order')
|
||||||
|
@ -217,7 +235,8 @@ class OrderProcessorTest extends TestCase
|
||||||
$paymentsEndpoint = Mockery::mock(PaymentsEndpoint::class);
|
$paymentsEndpoint = Mockery::mock(PaymentsEndpoint::class);
|
||||||
$orderFactory = Mockery::mock(OrderFactory::class);
|
$orderFactory = Mockery::mock(OrderFactory::class);
|
||||||
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
$threeDSecure = Mockery::mock(ThreeDSecure::class);
|
||||||
$threeDSecure->expects('proceedWithOrder')->andReturn(ThreeDSecure::REJECT);
|
$authorizedPaymentProcessor = Mockery::mock(AuthorizedPaymentsProcessor::class);
|
||||||
|
$settings = Mockery::mock(Settings::class);
|
||||||
|
|
||||||
$testee = new OrderProcessor(
|
$testee = new OrderProcessor(
|
||||||
$sessionHandler,
|
$sessionHandler,
|
||||||
|
@ -225,7 +244,9 @@ class OrderProcessorTest extends TestCase
|
||||||
$orderEndpoint,
|
$orderEndpoint,
|
||||||
$paymentsEndpoint,
|
$paymentsEndpoint,
|
||||||
$orderFactory,
|
$orderFactory,
|
||||||
$threeDSecure
|
$threeDSecure,
|
||||||
|
$authorizedPaymentProcessor,
|
||||||
|
$settings
|
||||||
);
|
);
|
||||||
|
|
||||||
$cart = Mockery::mock(\WC_Cart::class);
|
$cart = Mockery::mock(\WC_Cart::class);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue