Remove new-default-list-name feature flag [MAILPOET-3004]
This commit is contained in:
@ -24,7 +24,7 @@ In MailPoet, subscribers are organized into lists. This method returns an array
|
||||
[
|
||||
0 => [
|
||||
'id' => '3',
|
||||
'name' => 'My First List',
|
||||
'name' => 'Newsletter mailing list',
|
||||
'type' => 'default',
|
||||
'description' => 'This list is automatically created when you install MailPoet.',
|
||||
'created_at' => '2019-05-07 07:24:37',
|
||||
|
@ -11,7 +11,6 @@ use MailPoet\Cron\Workers\SubscriberLinkTokens;
|
||||
use MailPoet\Cron\Workers\UnsubscribeTokens;
|
||||
use MailPoet\Entities\FormEntity;
|
||||
use MailPoet\Entities\UserFlagEntity;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Mailer\MailerLog;
|
||||
@ -49,8 +48,6 @@ class Populator {
|
||||
/** @var ReferralDetector */
|
||||
private $referralDetector;
|
||||
const TEMPLATES_NAMESPACE = '\MailPoet\Config\PopulatorData\Templates\\';
|
||||
/** @var FeaturesController */
|
||||
private $flagsController;
|
||||
/** @var FormFactory */
|
||||
private $formFactory;
|
||||
/** @var FormsRepository */
|
||||
@ -61,7 +58,6 @@ class Populator {
|
||||
WPFunctions $wp,
|
||||
Captcha $captcha,
|
||||
ReferralDetector $referralDetector,
|
||||
FeaturesController $flagsController,
|
||||
FormsRepository $formsRepository,
|
||||
FormFactory $formFactory
|
||||
) {
|
||||
@ -151,7 +147,6 @@ class Populator {
|
||||
'Painter',
|
||||
'FarmersMarket',
|
||||
];
|
||||
$this->flagsController = $flagsController;
|
||||
$this->formsRepository = $formsRepository;
|
||||
}
|
||||
|
||||
@ -349,13 +344,10 @@ class Populator {
|
||||
if (!$defaultSegment instanceof Segment) {
|
||||
$defaultSegment = Segment::create();
|
||||
$newList = [
|
||||
'name' => $this->wp->__('My First List', 'mailpoet'),
|
||||
'name' => $this->wp->__('Newsletter mailing list', 'mailpoet'),
|
||||
'description' =>
|
||||
$this->wp->__('This list is automatically created when you install MailPoet.', 'mailpoet'),
|
||||
];
|
||||
if ($this->flagsController->isSupported(FeaturesController::NEW_DEFAULT_LIST_NAME)) {
|
||||
$newList['name'] = $this->wp->__('Newsletter mailing list', 'mailpoet');
|
||||
}
|
||||
$defaultSegment->hydrate($newList);
|
||||
$defaultSegment->save();
|
||||
}
|
||||
|
@ -8,13 +8,11 @@ class FeaturesController {
|
||||
|
||||
// Define features below in the following form:
|
||||
// const FEATURE_NAME_OF_FEATURE = 'name-of-feature';
|
||||
const NEW_DEFAULT_LIST_NAME = 'new-default-list-name';
|
||||
const TEMPLATES_SELECTION = 'templates-selection';
|
||||
|
||||
// Define feature defaults in the array below in the following form:
|
||||
// self::FEATURE_NAME_OF_FEATURE => true,
|
||||
private $defaults = [
|
||||
self::NEW_DEFAULT_LIST_NAME => false,
|
||||
self::TEMPLATES_SELECTION => false,
|
||||
];
|
||||
|
||||
|
@ -11,7 +11,7 @@ class ManageListsCest {
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForText('WordPress Users', 5, '[data-automation-id="listing_item_1"]');
|
||||
$i->see('My First List', '[data-automation-id="listing_item_3"]');
|
||||
$i->see('Newsletter mailing list', '[data-automation-id="listing_item_3"]');
|
||||
$i->seeNoJSErrors();
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ class ReinstallFromScratchCest {
|
||||
// Check lists
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForText('WordPress Users', 30, '[data-automation-id="listing_item_1"]');
|
||||
$i->see('My First List', '[data-automation-id="listing_item_3"]');
|
||||
$i->see('Newsletter mailing list', '[data-automation-id="listing_item_3"]');
|
||||
$i->seeNumberOfElements('[data-automation-id^=listing_item_]', 2);
|
||||
// Check subscribers
|
||||
$i->amOnMailPoetPage('Subscribers');
|
||||
|
@ -53,7 +53,7 @@ class SettingsPageBasicsCest {
|
||||
//go to settings and opt-in for comments
|
||||
$i->amOnMailPoetPage('Settings');
|
||||
$i->checkOption('[data-automation-id="subscribe-on_comment-checkbox"]');
|
||||
$i->selectOptionInSelect2('My First List');
|
||||
$i->selectOptionInSelect2('Newsletter mailing list');
|
||||
$i->click('[data-automation-id="settings-submit-button"]');
|
||||
//go to the post and perform commenting + opting
|
||||
$i->amOnPage('/');
|
||||
@ -71,7 +71,7 @@ class SettingsPageBasicsCest {
|
||||
$i->waitForText($comment, 10, '.comment-content');
|
||||
//check if user is really subscribed to a list
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->clickItemRowActionByItemName('My First List', 'View Subscribers');
|
||||
$i->clickItemRowActionByItemName('Newsletter mailing list', 'View Subscribers');
|
||||
$i->waitForText('Subscribers');
|
||||
$i->waitForText('test@test.com');
|
||||
$i->waitForText('Unconfirmed');
|
||||
|
@ -93,7 +93,7 @@ class SubscriberManageImportExportCest {
|
||||
$this->pasteSimpleList($i);
|
||||
$i->click('[data-automation-id="import-next-step"]');
|
||||
$this->chooseListAndConfirm($i);
|
||||
$i->see('3 subscribers added to "My First List".');
|
||||
$i->see('3 subscribers added to "Newsletter mailing list".');
|
||||
$i->click('View subscribers');
|
||||
$i->searchFor('mailpoet1@yopmail.com');
|
||||
$i->waitForText('mailpoet1@yopmail.com');
|
||||
|
@ -8,7 +8,6 @@ use MailPoet\API\JSON\Response as APIResponse;
|
||||
use MailPoet\API\JSON\v1\Setup;
|
||||
use MailPoet\Config\Activator;
|
||||
use MailPoet\Config\Populator;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Referrals\ReferralDetector;
|
||||
@ -29,8 +28,6 @@ class SetupTest extends \MailPoetTest {
|
||||
'doAction' => asCallable([WPHooksHelper::class, 'doAction']),
|
||||
]);
|
||||
|
||||
$featuresController = Stub::makeEmpty(FeaturesController::class);
|
||||
|
||||
$settings = SettingsController::getInstance();
|
||||
$referralDetector = new ReferralDetector($wp, $settings);
|
||||
$populator = new Populator(
|
||||
@ -38,7 +35,6 @@ class SetupTest extends \MailPoetTest {
|
||||
$wp,
|
||||
new Captcha(),
|
||||
$referralDetector,
|
||||
$featuresController,
|
||||
$this->diContainer->get(FormsRepository::class),
|
||||
$this->diContainer->get(FormFactory::class)
|
||||
);
|
||||
|
@ -14,7 +14,6 @@ use MailPoet\Cron\Workers\SendingQueue\Tasks\Newsletter as NewsletterTask;
|
||||
use MailPoet\Cron\Workers\StatsNotifications\Scheduler as StatsNotificationsScheduler;
|
||||
use MailPoet\DI\ContainerWrapper;
|
||||
use MailPoet\Entities\NewsletterEntity;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Logging\LoggerFactory;
|
||||
@ -73,13 +72,11 @@ class SendingQueueTest extends \MailPoetTest {
|
||||
wp_set_current_user($wpUsers[0]->ID);
|
||||
$this->settings = SettingsController::getInstance();
|
||||
$referralDetector = new ReferralDetector(WPFunctions::get(), $this->settings);
|
||||
$featuresController = Stub::makeEmpty(FeaturesController::class);
|
||||
$populator = new Populator(
|
||||
$this->settings,
|
||||
WPFunctions::get(),
|
||||
new Captcha,
|
||||
$referralDetector,
|
||||
$featuresController,
|
||||
$this->diContainer->get(FormsRepository::class),
|
||||
$this->diContainer->get(FormFactory::class)
|
||||
);
|
||||
|
@ -6,7 +6,6 @@ use Codeception\Stub;
|
||||
use Codeception\Stub\Expected;
|
||||
use MailPoet\Config\Populator;
|
||||
use MailPoet\Cron\Workers\SendingQueue\Tasks\Mailer as MailerTask;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Mailer\Mailer;
|
||||
@ -31,13 +30,11 @@ class MailerTest extends \MailPoetTest {
|
||||
wp_set_current_user($wpUsers[0]->ID);
|
||||
$this->settings = SettingsController::getInstance();
|
||||
$referralDetector = new ReferralDetector(WPFunctions::get(), $this->settings);
|
||||
$featuresController = Stub::makeEmpty(FeaturesController::class);
|
||||
$populator = new Populator(
|
||||
$this->settings,
|
||||
WPFunctions::get(),
|
||||
new Captcha,
|
||||
$referralDetector,
|
||||
$featuresController,
|
||||
$this->diContainer->get(FormsRepository::class),
|
||||
$this->diContainer->get(FormFactory::class)
|
||||
);
|
||||
|
@ -2,9 +2,7 @@
|
||||
|
||||
namespace MailPoet\Test\Newsletter;
|
||||
|
||||
use Codeception\Util\Stub;
|
||||
use MailPoet\Config\Populator;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Models\CustomField;
|
||||
@ -43,13 +41,11 @@ class ShortcodesTest extends \MailPoetTest {
|
||||
parent::_before();
|
||||
$this->settings = SettingsController::getInstance();
|
||||
$referralDetector = new ReferralDetector(WPFunctions::get(), $this->settings);
|
||||
$featuresController = Stub::makeEmpty(FeaturesController::class);
|
||||
$populator = new Populator(
|
||||
$this->settings,
|
||||
WPFunctions::get(),
|
||||
new Captcha,
|
||||
$referralDetector,
|
||||
$featuresController,
|
||||
$this->diContainer->get(FormsRepository::class),
|
||||
$this->diContainer->get(FormFactory::class)
|
||||
);
|
||||
|
@ -2,9 +2,7 @@
|
||||
|
||||
namespace MailPoet\Test\Subscription;
|
||||
|
||||
use Codeception\Util\Stub;
|
||||
use MailPoet\Config\Populator;
|
||||
use MailPoet\Features\FeaturesController;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\FormsRepository;
|
||||
use MailPoet\Models\Subscriber;
|
||||
@ -29,13 +27,11 @@ class UrlTest extends \MailPoetTest {
|
||||
parent::_before();
|
||||
$this->settings = SettingsController::getInstance();
|
||||
$referralDetector = new ReferralDetector(WPFunctions::get(), $this->settings);
|
||||
$featuresController = Stub::makeEmpty(FeaturesController::class);
|
||||
$populator = new Populator(
|
||||
$this->settings,
|
||||
WPFunctions::get(),
|
||||
new Captcha,
|
||||
$referralDetector,
|
||||
$featuresController,
|
||||
$this->diContainer->get(FormsRepository::class),
|
||||
$this->diContainer->get(FormFactory::class)
|
||||
);
|
||||
|
Reference in New Issue
Block a user