mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix indent
This commit is contained in:
parent
dcd9bfffdd
commit
65c048438c
1 changed files with 46 additions and 47 deletions
|
@ -13,9 +13,9 @@ use function Brain\Monkey\Functions\when;
|
|||
|
||||
class SettingsListenerTest extends ModularTestCase
|
||||
{
|
||||
private $appContainer;
|
||||
private $appContainer;
|
||||
|
||||
public function setUp(): void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@ -23,59 +23,58 @@ class SettingsListenerTest extends ModularTestCase
|
|||
}
|
||||
|
||||
public function testListen()
|
||||
{
|
||||
$settings = Mockery::mock(Settings::class);
|
||||
$settings->shouldReceive('set');
|
||||
{
|
||||
$settings = Mockery::mock(Settings::class);
|
||||
$settings->shouldReceive('set');
|
||||
|
||||
$setting_fields = $this->appContainer->get('wcgateway.settings.fields');
|
||||
$setting_fields = $this->appContainer->get('wcgateway.settings.fields');
|
||||
|
||||
$webhook_registrar = Mockery::mock(WebhookRegistrar::class);
|
||||
$webhook_registrar->shouldReceive('unregister')->andReturnTrue();
|
||||
$webhook_registrar->shouldReceive('register')->andReturnTrue();
|
||||
$webhook_registrar = Mockery::mock(WebhookRegistrar::class);
|
||||
$webhook_registrar->shouldReceive('unregister')->andReturnTrue();
|
||||
$webhook_registrar->shouldReceive('register')->andReturnTrue();
|
||||
|
||||
$cache = Mockery::mock(Cache::class);
|
||||
$cache = Mockery::mock(Cache::class);
|
||||
|
||||
$state = Mockery::mock(State::class);
|
||||
$state->shouldReceive('current_state')->andReturn(State::STATE_ONBOARDED);
|
||||
$bearer = Mockery::mock(Bearer::class);
|
||||
$state = Mockery::mock(State::class);
|
||||
$state->shouldReceive('current_state')->andReturn(State::STATE_ONBOARDED);
|
||||
$bearer = Mockery::mock(Bearer::class);
|
||||
|
||||
|
||||
$testee = new SettingsListener(
|
||||
$settings,
|
||||
$setting_fields,
|
||||
$webhook_registrar,
|
||||
$cache,
|
||||
$state,
|
||||
$bearer,
|
||||
$testee = new SettingsListener(
|
||||
$settings,
|
||||
$setting_fields,
|
||||
$webhook_registrar,
|
||||
$cache,
|
||||
$state,
|
||||
$bearer,
|
||||
PayPalGateway::ID
|
||||
);
|
||||
);
|
||||
|
||||
$_GET['section'] = PayPalGateway::ID;
|
||||
$_POST['ppcp-nonce'] = 'foo';
|
||||
$_POST['ppcp'] = [
|
||||
'client_id' => 'client_id',
|
||||
];
|
||||
$_GET['ppcp-tab'] = PayPalGateway::ID;
|
||||
$_GET['section'] = PayPalGateway::ID;
|
||||
$_POST['ppcp-nonce'] = 'foo';
|
||||
$_POST['ppcp'] = [
|
||||
'client_id' => 'client_id',
|
||||
];
|
||||
$_GET['ppcp-tab'] = PayPalGateway::ID;
|
||||
|
||||
when('current_user_can')->justReturn(true);
|
||||
when('wp_verify_nonce')->justReturn(true);
|
||||
when('current_user_can')->justReturn(true);
|
||||
when('wp_verify_nonce')->justReturn(true);
|
||||
|
||||
$settings->shouldReceive('has')
|
||||
->with('client_id')
|
||||
->andReturn('client_id');
|
||||
$settings->shouldReceive('get')
|
||||
->with('client_id')
|
||||
->andReturn('client_id');
|
||||
$settings->shouldReceive('has')
|
||||
->with('client_secret')
|
||||
->andReturn('client_secret');
|
||||
$settings->shouldReceive('get')
|
||||
->with('client_secret')
|
||||
->andReturn('client_secret');
|
||||
$settings->shouldReceive('persist');
|
||||
$cache->shouldReceive('has')
|
||||
->andReturn(false);
|
||||
$settings->shouldReceive('has')
|
||||
->with('client_id')
|
||||
->andReturn('client_id');
|
||||
$settings->shouldReceive('get')
|
||||
->with('client_id')
|
||||
->andReturn('client_id');
|
||||
$settings->shouldReceive('has')
|
||||
->with('client_secret')
|
||||
->andReturn('client_secret');
|
||||
$settings->shouldReceive('get')
|
||||
->with('client_secret')
|
||||
->andReturn('client_secret');
|
||||
$settings->shouldReceive('persist');
|
||||
$cache->shouldReceive('has')
|
||||
->andReturn(false);
|
||||
|
||||
$testee->listen();
|
||||
}
|
||||
$testee->listen();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue