Capture virtual renewal orders functionality for subscriptions

This commit is contained in:
Narek Zakarian 2022-06-29 16:52:19 +04:00
parent 998a327ebc
commit 90c2a01350
3 changed files with 94 additions and 15 deletions

View file

@ -22,6 +22,8 @@ use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
class RenewalHandlerTest extends TestCase
{
@ -45,6 +47,11 @@ class RenewalHandlerTest extends TestCase
$this->purchaseUnitFactory = Mockery::mock(PurchaseUnitFactory::class);
$this->payerFactory = Mockery::mock(PayerFactory::class);
$this->environment = new Environment(new Dictionary([]));
$authorizedPaymentProcessor = Mockery::mock(AuthorizedPaymentsProcessor::class);
$settings = Mockery::mock(Settings::class);
$settings
->shouldReceive('has')
->andReturnFalse();
$this->logger->shouldReceive('error')->andReturnUsing(function ($msg) {
throw new Exception($msg);
@ -57,7 +64,9 @@ class RenewalHandlerTest extends TestCase
$this->orderEndpoint,
$this->purchaseUnitFactory,
$this->payerFactory,
$this->environment
$this->environment,
$settings,
$authorizedPaymentProcessor
);
}