Commit Graph

51 Commits

Author SHA1 Message Date
 Ján Mikláš
0198eae41a Update WC action when setting cart item to zero
[MAILPOET-6069]
2024-09-23 08:32:06 +02:00
Rostislav Wolny
5fdba0e170 Replace current_time usage in tests
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
alex-mpoet
80a7d3c5d7 Trigger abandoned cart check on WP user login
[MAILPOET-6161]
2024-08-07 12:45:42 +02:00
David Remer
a24922a0d2 Use SubscriberEntity constants in tests
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
David Remer
18852e8ea4 Test abandoned cart gets scheduled regardless of subscriber status
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
Mike Jolley
0d6fe6e5eb Apply rules to tests and tasks 2024-03-21 16:57:59 +01:00
Jan Jakes
bb29f25c40 Remove simple usages of MailPoet\Tasks\Sending from integration tests
[MAILPOET-4375]
2023-11-02 12:53:36 +01:00
Rodrigo Primo
e4f0b89032 Replace expect()->contains() with verify()->arrayContains()
codeception/verify 2.1 removed support for expect()->contains() so we need
to replace it with verify()->arrayContains().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
c41e5c7d0f Replace expect()->hasNotKey() with verify()->arrayHasNotKey()
codeception/verify 2.1 removed support for expect()->hasNotKey() so we need
to replace it with verify()->arrayHasNotKey().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
9b56fdc688 Replace expect()->count() with verify()->arrayCount()
codeception/verify 2.1 removed support for expect()->count() so we need
to replace it with verify()->arrayCount().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
e4136fee8c Replace expect()->isEmpty() with verify()->empty()
codeception/verify 2.1 removed support for expect()->isEmpty() so we need
to replace it with verify()->empty().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
5bc5b5ebd2 Replace expect()->notEmpty() with verify()->notEmpty()
codeception/verify 2.1 removed support for expect()->notEmpty() so we need
to replace it with verify()->notEmpty().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
a70067a34c Replace expect()->hasKey() with verify()->arrayHasKey()
codeception/verify 2.1 removed support for expect()->hasKey() so we need
to replace it with verify()->arrayHasKey().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
709be1d541 Replace expect()->null() with verify()->null()
codeception/verify 2.1 removed support for expect()->null() so we need
to replace it with verify()->null().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
997f635d4a Replace expect()->false() with verify()->false()
codeception/verify 2.1 removed support for expect()->false() so we need
to replace it with verify()->false().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
9adbf81a78 Replace expect()->true() with verify()->true()
codeception/verify 2.1 removed support for expect()->true() so we need
to replace it with verify()->true().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Rodrigo Primo
afe378ba22 Replace expect()->equals() with verify()->equals()
codeception/verify 2.1 removed support for expect()->equals() so we need
to replace it with verify()->equals().

[MAILPOET-5664]
2023-10-24 08:58:22 +03:00
Jan Jakes
b296e40077 Extract Carbon datetime reset to test bootstrap
MAILPOET-5145
2023-04-07 12:11:12 -05:00
Jan Jakes
70e6447e28 Extract WPFunctions reset to test bootstrap
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
alex-mailpoet
66dc6e67ab Remove unnecessary override
[MAILPOET-4872]
2023-02-13 14:13:44 -03:00
Jan Lysý
40f4216ff8 Add method for getting WC coupons
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
Jan Jakes
82aeb89854 Use strict types in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Rostislav Wolny
a3e1f8d8c6 Fix flaky AbandonedCartTest
Fix the flaky DateTime comparisons test by allowing 1 second delta
[MAILPOET-4723]
2022-11-07 10:10:17 +01:00
Rostislav Wolny
cd3652eaa6 Fix canceling multiple automatic emails
When we deleted sending queue using SQL it remained in the entity manager
and subsequent flush (not the first one) triggered the error, because it didn't know the ScheduledTask entity attached
to the orphaned SendingQueue entity.

This commit fixes this by refactoring deletion of sending queue using standard repository method.
After fixing the issue for sending queue there was another issue with SchedulesTaskSubscriberEntity that remained in memory.
I fixed that by detaching those. Theoretically there might be many SchedulesTaskSubscriberEntities for an Automatic email so
I consider still safer to delete using SQL and if there are some loaded (in this case there is one) detach them.
[MAILPOET-4741]
2022-10-24 14:03:54 +02:00
Jan Lysý
09a54fdcd1 Fix dependencies in tests
[MAILPOET-4372]
2022-10-12 11:44:37 +02:00
Rodrigo Primo
a171206da2 Add basic test to cover scheduling first purchase email for guest customer
[MAILPOET-4570]
2022-10-03 15:10:36 +02:00
Rostislav Wolny
21508235fa Remove forgotten group annotation on a test case
The whole test has the group annotation so it is not needed for the particular tests case.
[MAILPOET-4566]
2022-09-08 13:02:52 +02:00
Rostislav Wolny
8a48db30b6 Add backup and restore for global WC_Cart in AbandonedCartTest
[MAILPOET-4566]
2022-09-08 13:02:52 +02:00
Rostislav Wolny
ed5bd8de61 Add Woo dependent tests to woo group
Mark all integration tests that are related to WooCommerce with group "woo".
[MAILPOET-4566]
2022-09-08 13:02:52 +02:00
John Oleksowicz
c403097c07 Always use real WC instead of mock
MAILPOET-4566
2022-09-08 13:02:52 +02:00
Jan Lysý
745ba0d5e0 Replace old model from PurchasedProduct
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
448847a4b9 Replace old model from PurchasedInCategory
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
c1a579d5fc Replace old model usage with Doctrine
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
d340909187 Replace repeating code with using factory
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
fa4ee3ff86 Fix adding newsletter options to collection
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
4ba5c6ce0c Remove old model from Scheduler
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Jan Lysý
882e096c81 Replace old model usage with Doctrine
[MAILPOET-4141]
2022-06-20 12:00:47 +02:00
Brezo Cordero
c992bdc2c0 Change createAbandonedCartEmail to use mocked currentTime
[MAILPOET-4286]
2022-05-29 08:58:24 +01:00
David Remer
fce14358bf Revert "Replace NewsletterOption and NewsletterOptionField models"
This reverts commit 9b087f719f.
2022-05-17 12:27:46 +02:00
Rodrigo Primo
d89067854c Replace NewsletterOption and NewsletterOptionField models
This commit repleaces the old NewsletterOption and NewsletterOptionField
models with Doctrine code in several test classes.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
David Remer
ca3f8bdc43 Make Scheduler non-static
[MAILPOET-4252]
2022-04-25 12:08:18 +02:00
John Oleksowicz
a8b62130ec Remove duplicate test
[MAILPOET-3518]
2022-02-09 16:33:06 +01:00
John Oleksowicz
bfcb6d745f Add test for preventing duplicates
[MAILPOET-3518]
2022-02-09 16:33:06 +01:00
John Oleksowicz
4d3e2b57fe Add product category re-sending test
[MAILPOET-3518]
2022-02-09 16:33:06 +01:00
John Oleksowicz
ef40730631 Only store relevant meta for category emails
[MAILPOET-3518]
2022-02-09 16:33:06 +01:00
John Oleksowicz
ec8ff46a29 Only store relevant meta for product purchases
[MAILPOET-3518]
2022-02-09 16:33:06 +01:00
Rostislav Wolny
ad94cffdea Remove proprietary AbandonedCartPageVisitTracker
[MAILPOET-3897]
2022-02-07 09:38:25 +01:00
Rostislav Wolny
f3208ca585 Use subscriber activity callback for postponing abandoned cart emails
[MAILPOET-3897]
2022-02-07 09:38:25 +01:00