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 test was failing sometimes on CircleCI. Using isToday() instead of
checking if the seconds match should reduce flakiness and is enough for
what we need to test.
[MAILPOET-4020]
This commits improves the test coverage for
ManageSubscriptionFormRenderer by creating two custom fields for the
test subscriber and checking that those custom fields are included in
the output returned by ManageSubscriptionFormRenderer::renderForm().
[MAILPOET-4020]
The test class ManageSubscriptionFormRendererTest creates a subscriber
with a segment. But when calling $this->formRenderer->renderForm(), it
was passing the subscriber without information about its segments. This
meant that the output returned by renderForm() wrongly had the list of
segments without the subscriber segment checked.
This commit fixes this problem by passing the subscriber with the
segments to renderForm() and changing the expected HTML that should be
returned.
[MAILPOET-4020]
This commit improves the test PagesTest::testItUnsubscribes() but adding
a segment to the subscriber and making sure that the status of the
SubscriberSegmentEntity changes when Pages::unsubscribe() is called.
Before this change, the test was not covering this part of the execution
path of the tested code.
[MAILPOET-4020]
This commit replaces the old Paris models Newsletter, NewsletterOption and
NewsletterOptionField with the correspondent Doctrine entities.
[MAILPOET-4020]
This commit adds an integration test to check that unconfirmed data is persisted
when Pages::confirm() is called and the subscriber has some unconfirmed
data set. Before there was no test covering this part of the code.
[MAILPOET-4020]