mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix tests, add http redirector
This commit is contained in:
parent
337959feda
commit
cc21dd78e7
9 changed files with 116 additions and 19 deletions
|
@ -5,6 +5,8 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Settings;
|
|||
use Requests_Utility_CaseInsensitiveDictionary;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use WooCommerce\PayPalCommerce\Helper\RedirectorStub;
|
||||
use WooCommerce\PayPalCommerce\Helper\StubRedirectionException;
|
||||
use WooCommerce\PayPalCommerce\ModularTestCase;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
use Mockery;
|
||||
|
@ -50,7 +52,8 @@ class SettingsListenerTest extends ModularTestCase
|
|||
$signup_link_cache,
|
||||
$signup_link_ids,
|
||||
$pui_status_cache,
|
||||
$dcc_status_cache
|
||||
$dcc_status_cache,
|
||||
new RedirectorStub()
|
||||
);
|
||||
|
||||
$_GET['section'] = PayPalGateway::ID;
|
||||
|
@ -85,7 +88,7 @@ class SettingsListenerTest extends ModularTestCase
|
|||
$dcc_status_cache->shouldReceive('has')
|
||||
->andReturn(false);
|
||||
|
||||
expect('wp_safe_redirect')->once();
|
||||
$this->expectException(StubRedirectionException::class);
|
||||
|
||||
$testee->listen();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue