Merge pull request #708 from woocommerce/PCP-581-capture-virtual-only-orders-problem-for-subscriptions

Capture virtual renewal orders functionality for subscription products
This commit is contained in:
Alex Pantechovskis 2022-07-26 16:22:00 +03:00 committed by GitHub
commit 5a1c65d3e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 17 deletions

View file

@ -23,6 +23,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
{
@ -48,6 +50,11 @@ class RenewalHandlerTest extends TestCase
$this->shippingPreferenceFactory = Mockery::mock(ShippingPreferenceFactory::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);
@ -61,7 +68,9 @@ class RenewalHandlerTest extends TestCase
$this->purchaseUnitFactory,
$this->shippingPreferenceFactory,
$this->payerFactory,
$this->environment
$this->environment,
$settings,
$authorizedPaymentProcessor
);
}