Commit Graph

134 Commits

Author SHA1 Message Date
Rostislav Wolny
5fdba0e170 Replace current_time usage in tests
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
Jan Lysý
26a98f1000 Update composer package doctrine/dbal
We cannot update to the latest version of the dbal 3 because there is a another package conflict.
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
Mike Jolley
0d6fe6e5eb Apply rules to tests and tasks 2024-03-21 16:57:59 +01:00
John Oleksowicz
a9140a702e Add backend logic for purchase with tag filter
MAILPOET-4985
2024-03-13 10:24:42 +01:00
John Oleksowicz
604de62af6 Add filter data mapper tests
MAILPOET-5467
2024-03-11 10:52:30 +01:00
John Oleksowicz
a4a2ef3b1f Add support for local variation attributes
In WooCommerce it's possible to create attributes that are local to a
specific product. When these attributes are used to generate variations,
 they are stored in the postmeta table.

MAILPOET-5467
2024-03-11 10:52:30 +01:00
John Oleksowicz
6307cfdcff Add filter data validation
MAILPOET-5467
2024-03-11 10:52:30 +01:00
John Oleksowicz
bfa3770d99 Add backend logic for purchase by attribute filter
MAILPOET-5467
2024-03-11 10:52:30 +01:00
Rodrigo Primo
857ed69c61 Update integration test after change in \MailPoet\Segments\WP
In a previous commit, \MailPoet\Segments\WP was refactored to use
Doctrine instead of Paris. Paris would always convert subscriber emails
to lowercase. We don't do this with the Subscriber entity so it was
necessary to update this test after the refactor.

[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
John Oleksowicz
dda7da465f Update # of orders filter for orders with coupon
MAILPOET-5373
2024-01-14 18:40:17 +05:00
John Oleksowicz
08f2540bf9 Fix logic for ALL operator
Determining the proper conditions for product categories when we are
looking for a customer who purchased all of the provided category IDs is
 tricky because we need to account for the hierarchical nature of these
 categories. In order to avoid more complex logic, I decided to apply
 the ANY logic for each individual category ID and then return the
 intersection of those queries.

MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
0a8e58928f Fix test category creation
The products should use Woo product categories, not default WordPress
categories

MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
c536959331 Move test data creation into tests
This will allow for more complex test cases without having to worry
about how new data will affect existing tests

MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
463fcc23cb Simplify test data creation and fix cleanup
MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
88263067b7 Fix woo category filter
The previous implementation was based on the number of order IDs, which
was not reliable.

MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
9e33dc57f9 Add test customer who ordered multiple product categories
MAILPOET-5264
2023-12-18 12:02:48 +01:00
John Oleksowicz
e4386fd41a Update tests to use verify instead of expect
MAILPOET-5577
2023-10-30 10:51:04 +01:00
John Oleksowicz
9985405d82 Add backend logic for number of clicks filter
MAILPOET-5577
2023-10-30 10:51:04 +01:00
John Oleksowicz
c28eed2388 Backend logic for number of emails received
MAILPOET-5577
2023-10-30 10:51:04 +01:00
John Oleksowicz
10f593bf2c Backend logic for first order filter
MAILPOET-5577
2023-10-30 10:51:04 +01:00
Rodrigo Primo
fac7fbb4f1 Replace expect()->notContains() with verify()->arrayNotContains()
codeception/verify 2.1 removed support for expect()->lessThan() so we need
to replace it with verify()->lessThan().

[MAILPOET-5664]
2023-10-24 08:58:22 +03: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
a1f57361c5 Replace expect()->array() with verify()->isArray()
codeception/verify 2.1 removed support for expect()->array() so we need
to replace it with verify()->isArray().

[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
1865fc8930 Replace expect()->isInstanceOf() with verify()->instanceOf()
codeception/verify 2.1 removed support for expect()->isInstanceOf() so we need
to replace it with verify()->instanceOf().

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

[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
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
John Oleksowicz
b1dd110bf8 Add lookup data retrieval for used shipping method
For ease of lookup, I changed the helper to return an array with keys
corresponding to the instanceId of the shipping methods. I couldn't see
anywhere else in the codebase where the keys would have mattered.

MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
97a53cb1aa Add lookup data retrieval for used payment method
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
c4fc8649f4 Add lookup data retrieval for used coupon code
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
67cff8992e Add lookup data retrieval for woo product
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
9d8fb08026 Add lookup data retrieval for woo category
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
54461d89ba Add lookup data retrieval for wordpress user role
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
d1f77d3ee5 Add lookup data retrieval for subscribed to list
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
af9a6cbb67 Add lookup data retrieval for subscribed via form
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
40785d047e Add lookup data retrieval for custom fields
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
beda4f8d89 Add lookup data retrieval for email filters
MAILPOET-5625
2023-10-13 11:21:42 +02:00
John Oleksowicz
984aa81f86 Add lookup data retrieval for automation filters
MAILPOET-5625
2023-10-13 11:21:42 +02:00
Jan Jakes
6610e08b25 Use deterministic order in FilterHandlerTest
[MAILPOET-5544]
2023-08-23 14:16:51 -05:00
John Oleksowicz
8d03db5dcc Add lifetime option to payment/shipping filters
MAILPOET-5496
2023-08-17 13:49:08 +02:00
John Oleksowicz
aac40e2a24 Add mapping test for used coupon code data
MAILPOET-5007
2023-08-14 13:49:55 +02:00
John Oleksowicz
a18dddedf3 Convert FilterDataMapperTest to integration test
It was becoming cumbersome to update the tests with new mocks every time
 the constructor changes in FilterDataMapper, which will become more
 common as more of the validation logic gets moved into the filter
 classes themselves.

MAILPOET-5007
2023-08-14 13:49:55 +02:00
John Oleksowicz
a446a13354 Add backend logic for used coupon code filter
MAILPOET-5007
2023-08-14 13:49:55 +02:00
John Oleksowicz
d7e283dea9 Handle empty strings as blank in custom fields
MAILPOET-4996
2023-08-07 12:03:49 +02:00
John Oleksowicz
fe318f5a30 Add 'not contains' option for text custom fields
MAILPOET-4996
2023-08-07 12:03:49 +02:00
John Oleksowicz
a1b51aecf0 Update backend logic to support (not)blank
MAILPOET-4996
2023-08-07 12:03:49 +02:00
John Oleksowicz
ce9cbdc45d Add backend logic for number of reviews filter
MAILPOET-5413
2023-08-07 11:06:27 +02:00