- 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 only thing Security::generateToken was providing was a default value
for the $action, which created a pattern of using the same $action
everywhere, which may not be the best way to go.
Since it was essentially a wrapper for WP's built-in nonce functions,
it seemed clearer to use those functions directly to be more explicit
about how we're handling tokens.
[MAILPOET-2030]
This commit removes the method Posts::getTerms() as it existed to add a
compatibility layer for sites running WP < 4.5.0 and we don't support
this version anymore. The signature of the WP get_terms() function was
changed in version 4.5.0 and that is why this compatibility layer was
needed.
The integration test class for this method was also removed. The only
place where this method was used, AutomatedLatestContent::getTerms(),
now call WPFunctions->getTerms() directly. A very basic integration test
was added to cover the happy path of AutomatedLatestContent::getTerms().
[MAILPOET-4225]