This commit deprecates the following Models\Newsletter methods:
- \MailPoet\Models\Newsletter::filterType()
- \MailPoet\Models\Newsletter::getWelcomeNotificationsForSegments()
- \MailPoet\Models\Newsletter::duplicate()
I'm doing this as part of a ticket to replace the models
NewsletterOption and NewsletterOptionField with Doctrine code. The
methods deprecated here use those models. But since they are not used
anymore in our codebase, I figured it would be easier to deprecate them
instead of replacing the models.
[MAILPOET-4150]
This commit replaces old Paris code with Doctrine entities in
SubscriberTest::_after() and it also truncate only the entities that are
actually used inside the test class. Before this change, the class was
unnecessarily truncating entities that were not used. I'm doing this
commit as part of task to remove all usages of the old NewsletterOption
model and that is why I'm not touching the remaining models in other
methods of this class.
[MAILPOET-4150]
While removing some deprecated models in the commit
a525b96f16, I noticed that we maintain a
list of tables that needs to be truncated before running the integration
tests. To make it easier when removing future models and to make sure
the list of tables is always updated, in this commit, I'm removing the
manual list and changing the code to dynamically get the tables and
truncate them.
The code that I removed from _bootstrap.php, meant that PHPStan error
was not present anymore, so it was possible to update its baseline files
to remove the ignores for that error.
[MAILPOET-4325]
This commit removes the models Form, NewsletterLink and
StatisticsUnsubscribes as they were deprecated over six months ago and
are not used anymore in our codebase.
[MAILPOET-4325]
We already have a specific test for the newsletter validator to check
for the missing unsubscribe link case. All we really care about for the
sending queue is that it rejects newsletters that are considered invalid
for any reason.
MAILPOET-4236
Checking the subscriber limit has nothing to do with the newsletter
itself, so it makes more sense to continue to perform that check as
needed elsewhere in the codebase.
MAILPOET-4236
- Rename validator to newsletterValidator for clarity
- Add validation for ALC content
- Refactor tests to use data factory for consistency and to avoid
validation issues
- Add separate tests for NewsletterValidator service
- Add test helper for retrieving service with private properties
overridden by name
[MAILPOET-4236]
This prevents users from activating automatic emails from listing pages
that are not valid.
This also adds more checks for the content of a newsletter, requiring
that a newsletter have at least one content block in order to be valid.
This change makes the server side validation check match what we're
checking in the editor in mailpoet/assets/js/src/newsletter_editor
/components/save.js and mailpoet/assets/js/src/newsletters/send.jsx
[MAILPOET-4236]
The test class \MailPoet\Subscribers\ImportExport\PersonalDataExporters\NewslettersExporterTest
calls the modified
\MailPoet\Models\StatisticsNewsletters::getAllForSubscriber() method
several times so it can be used to confirm that the changes made in this
commit work as expected.
[MAILPOET-4150]
Replace old Paris code with Doctrine code
I was not able to test that the command `./do gen:data past_revenues` is
still working after the changes here as it is failing on master due to
an unrelated error. I will start a discussion about this problema and
potentially create a Jira ticket.
[MAILPOET-4150]
I'm doing as part of the ticket to replace other models as it will make
replacing MailPoet\Models\StatisticsClicks and
MailPoet\Models\StatisticsOpens in AutomatedEmailsTest easier.
[MAILPOET-4150]