Fix tests, add http redirector

This commit is contained in:
Alex P 2023-03-16 18:13:41 +02:00
parent 337959feda
commit cc21dd78e7
No known key found for this signature in database
GPG key ID: 54487A734A204D71
9 changed files with 116 additions and 19 deletions

View file

@ -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();
}