Refactor getManageUrl to instance method

[MAILPOET-2381]
This commit is contained in:
Rostislav Wolny
2019-09-23 14:38:12 +02:00
committed by Jack Kitterhing
parent 21fba11893
commit 4e75f8883e
6 changed files with 27 additions and 11 deletions

View File

@@ -26,6 +26,8 @@ class ShortcodesTest extends \MailPoetTest {
public $subscriber;
/** @var SettingsController */
private $settings;
/** @var SubscriptionUrl */
private $subscription_url_factory;
function _before() {
parent::_before();
@@ -44,6 +46,7 @@ class ShortcodesTest extends \MailPoetTest {
$this->subscriber
);
$this->settings->set('tracking.enabled', false);
$this->subscription_url_factory = new SubscriptionUrl(WPFunctions::get(), $this->settings);
}
function testItCanExtractShortcodes() {
@@ -300,7 +303,7 @@ class ShortcodesTest extends \MailPoetTest {
];
$links = [
SubscriptionUrl::getUnsubscribeUrl(null),
SubscriptionUrl::getManageUrl(null),
$this->subscription_url_factory->getManageUrl(null),
NewsletterUrl::getViewInBrowserUrl(null, $this->newsletter, false, false, true),
];
$result = $shortcodes_object->process($shortcodes);