Merge pull request #657 from woocommerce/PCP-687-do-not-call-partner-referrals-si

Cache partner referrals signup links
This commit is contained in:
Emili Castells 2022-06-14 15:05:15 +02:00 committed by GitHub
commit 259f824dac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 165 additions and 22 deletions

View file

@ -32,12 +32,12 @@ class SettingsListenerTest extends ModularTestCase
$webhook_registrar = Mockery::mock(WebhookRegistrar::class);
$webhook_registrar->shouldReceive('unregister')->andReturnTrue();
$webhook_registrar->shouldReceive('register')->andReturnTrue();
$cache = Mockery::mock(Cache::class);
$state = Mockery::mock(State::class);
$state->shouldReceive('current_state')->andReturn(State::STATE_ONBOARDED);
$bearer = Mockery::mock(Bearer::class);
$signup_link_cache = Mockery::mock(Cache::class);
$signup_link_ids = array();
$testee = new SettingsListener(
$settings,
@ -46,7 +46,9 @@ class SettingsListenerTest extends ModularTestCase
$cache,
$state,
$bearer,
PayPalGateway::ID
PayPalGateway::ID,
$signup_link_cache,
$signup_link_ids
);
$_GET['section'] = PayPalGateway::ID;
@ -74,6 +76,8 @@ class SettingsListenerTest extends ModularTestCase
$settings->shouldReceive('persist');
$cache->shouldReceive('has')
->andReturn(false);
$signup_link_cache->shouldReceive('has')
->andReturn(false);
$testee->listen();
}