Commit Graph

55 Commits

Author SHA1 Message Date
Rodrigo Primo
b98a17bc43 Remove remaining uses of Subscriber model from BuiltInCaptchaValidatorTest
[MAILPOET-5361]
2023-05-30 11:16:46 -05:00
Jan Lysý
c711eac7f4 Update custom fields on confirmation when are stored in unconfirmed data
[MAILPOET-5246]
2023-05-03 11:31:24 +02:00
John Oleksowicz
376dca1098 Remove unnecessary truncating
MAILPOET-5145
2023-04-07 12:11:12 -05:00
John Oleksowicz
cd0b795ac8 Extract customer creation/cleanup
This also ensures that cleanup always runs after all integration tests

MAILPOET-5145
2023-04-07 12:11:12 -05:00
John Oleksowicz
c75bc388c9 Remove unnecessary cleanup code
MAILPOET-5145
2023-04-07 12:11:12 -05:00
John Oleksowicz
57eb438eb8 Don't assume auto increment of 1
MAILPOET-5145
2023-04-07 12:11:12 -05:00
David Remer
b17a9cb4ae Add test to ensure HTTP_RANGE headers do not reload captcha
[MAILPOET-5032]
2023-02-08 13:08:09 +01:00
Jan Lysý
eb53973799 Remove logEntity cleanup
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
Jan Lysý
e02b631172 Add log entities cleanup
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
Sam Najian
9036b210a0 Add test for click stat recording for 1-click
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
Sam Najian
f337ac388b Fix wrong assertions in PagesTest
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
Jan Jakes
d66fbb1c20 Fix confirmed IP value in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Jan Jakes
82aeb89854 Use strict types in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
David Remer
7db40b27b5 Fix errors automatically with phpcbf
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
Sam Najian
3e756bfadd Add test to assert correct unsubscription method is saved
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
Sam Najian
735d33d05b Add method of tracking when tracking unsubscriptions
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
David Remer
d2ec7bba42 Replace instance_of asserts in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
David Remer
5e0e89408c Test CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
4832771185 Refactor the captcha system
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.

Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.

The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.

[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
7fb8d64628 Rename CaptchaRenderer to CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
Oluwaseun Olorunsola
8b922681b6 Use boolean instead of integer for displayInManageSubscriptionPage column
MAILPOET-4669
2022-11-21 15:21:29 +01:00
Oluwaseun Olorunsola
c54a5213b3 Update tests
MAILPOET-4669
2022-11-21 15:21:29 +01:00
Jan Jakes
725e0ecb00 Remove automation feature flag
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
David Remer
87ced17813 Use submit button label of form for captcha submit button
[MAILPOET-4496]
2022-09-14 11:44:09 +02:00
Jan Lysý
381565fc1f Improve integration ManageTest class
[MAILPOET-4350]
2022-08-01 13:28:57 +02:00
Jan Lysý
fb05cc4297 Remove old model from Manage
[MAILPOET-4350]
2022-08-01 13:28:57 +02:00
Rodrigo Primo
955731eeb5 Replace Paris models with Doctrine entities in FormTest
[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
Rodrigo Primo
ad29073715 Replace Paris models with Doctrine entities in Subscription\Captcha
[MAILPOET-4351]
2022-07-13 16:09:41 +02:00
Jan Lysý
282bea4cfb Remove old model usage from NewSubscriberNotificationMailerTest
[MAILPOET-4352]
2022-07-13 15:36:14 +02:00
Jan Lysý
d340909187 Replace repeating code with using factory
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Berkay Simsek
0dc35da401 Improve autocomplete accessibility for names in forms
Changed the autocomplete attributes for input fields: 'first_name' & 'last_name' to comply with the WCAG-standards for autocompletion.
[MAILPOET-4408]
2022-06-13 17:15:44 +02:00
Jan Lysý
81bfbd5bf4 Add autocomplete attribute for text inputs in forms
[MAILPOET-4284]
2022-05-16 13:15:59 +02:00
Jan Lysý
d019ad9bdb Remove using Idiorm and replace it by Doctrine
[MAILPOET-4137]
2022-04-25 10:58:18 +02:00
Sam
f92b6a2e1e Revert "Revert "Fix a failing test with too much dependecy on db state""
This reverts commit 8aa2565e17.
2022-04-18 11:43:47 +02:00
Rodrigo Primo
8aa2565e17 Revert "Fix a failing test with too much dependecy on db state"
This reverts commit 5f5a4d576f.
2022-04-11 16:30:59 -03:00
Sam Najian
5f5a4d576f Fix a failing test with too much dependecy on db state
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Jan Lysý
eb07872d13 Disable segments validation when form ID is empty
[MAILPOET-4155]
2022-04-11 15:30:48 +02:00
John Oleksowicz
fc1f3e6dc2 Inline generateToken for clarity
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]
2022-04-11 10:29:35 +02:00
Rodrigo Primo
2e374d1a3b Remove unused property from Pages
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
e806a1288b Update test to reduce flakiness
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]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
17f562a9c5 Remove last usages of Subscriber model from the Pages class
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
794c7eb16f Improve test coverage for ManageSubscriptionFormRenderer
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]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
ee4df28cc3 Fix a bug in ManageSubscriptionFormRendererTest
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]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
bb47db85b8 Improve PagesTest::testItUnsubscribes()
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]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
74bb3be3da Replace remaining Paris models with Doctrine entities in PagesTest
This commit replaces the old Paris models Newsletter, NewsletterOption and
NewsletterOptionField with the correspondent Doctrine entities.

[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
250e450c82 Replace most usages of old Subscriber model with SubscriberEntity in the Pages class
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
84d49caa33 Add integration test to check that unconfirmed data is persisted
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]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
d613ac16aa Replace old SendingQueue model with Doctrine entity in PagesTest
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
123a27a6bb Replace old Subscriber and SubscriberSegment models with Doctrine
This commit replaces the old Subscriber and SubscriberSegment models
with Doctrine entities in the class PagesTest.

[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rodrigo Primo
14aa6eb3a5 Replace old Subscriber model with SubscriberEntity in PagesTest
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00