Commit Graph

46 Commits

Author SHA1 Message Date
Jan Jakes
8ba4335dfb Optimize and cache term loading
[MAILPOET-5942]
2024-03-18 11:53:16 +01:00
John Oleksowicz
efe4c47568 Display different notices before Feb 1st
MAILPOET-5819
2024-01-11 20:13:59 +05:00
Jan Lysý
41a55262fe Fix PHPStan warnings in tests
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
Jan Lysý
d60004da2a Add ListBlock integration test
As a part of this commit is a new method validating HTML. I moved it to the bootstrap to avoid repetition in the future.
[MAILPOET-5645]
2023-11-11 09:38:35 +04:00
John Oleksowicz
75b17ba0ba Don't clean newsletter_option_fields table
Option field records are created at plugin activation and some of our
code assumes at least one record will exist.

MAILPOET-5161
2023-10-23 17:40:54 +02:00
Jan Jakes
ad5b601629 Leave management of WC post types to WooCommerce
[MAILPOET-5409]
2023-06-15 13:39:38 +03:00
alex-mailpoet
4f1afa388f Clean up transient cache in tests where necessary
[MAILPOET-5180]
2023-05-22 14:13:05 +02: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
Jan Jakes
c1babe49db Remove more no longer necessary test cleanups
MAILPOET-5145
2023-04-07 12:11:12 -05:00
John Oleksowicz
9455eebb60 Add back scheduled task cleanup
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
Rostislav Wolny
b1ec1b9500 Add helper method for updating updatedAt of an entity in integration tests
We can't simply set updatedAt via setter on the entity. The value gets overwritten
in the TimeStampListener. This commit adds a simple method that saves updatedAt via
dbal connection and refreshes the entity.
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
alex-mailpoet
d8d859d209 Declare properties to avoid dynamic usage in codeception
[MAILPOET-4872]
2023-02-13 14:13:44 -03:00
Jan Jakes
82aeb89854 Use strict types in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Jan Jakes
725e0ecb00 Remove automation feature flag
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
Jan Jakes
2e328b6d7f Move temporary automation migrator to a new migration
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
Jan Jakes
0d10f4b1dd Enable mocking non-object properties in test service overrides
[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Rodrigo Primo
f6708d9526 Change the system that is used to prevent skipped tests
This commit changes the system that is used to prevent skipped tests
when CircleCI executes the integration tests against the trunk
and release branches. After this commit, the integration tests will use
the same system that is used by the acceptance tests. Besides
consolidating everything into a single system, this change is necessary
because we will need to know the name of the tests as we want to allow
some integration tests to be skipped in some circumstances, and this was
not possible with the old system.

[MAILPOET-4765]
2022-11-04 12:43:48 +01:00
Rodrigo Primo
3ad606a767 Revert "Change the system that is used to prevent skipped tests"
This reverts commit 363ee93c25.
2022-11-03 12:29:48 -03:00
Rodrigo Primo
363ee93c25 Change the system that is used to prevent skipped tests
This commit changes the system that is used to prevent skipped tests
when CircleCI executes the integration tests against the trunk
and release branches. After this commit, the integration tests will use
the same system that is used by the acceptance tests. Besides
consolidating everything into a single system, this change is necessary
because we will need to know the name of the tests as we want to allow
some integration tests to be skipped in some circumstances, and this was
not possible with the old system.

[MAILPOET-4765]
2022-11-02 10:27:34 +01:00
Rodrigo Primo
3320d1687e Remove messages showing each truncated table
This commit removes the messages that were displayed during the initial
stages of the integration tests execution showing the tables that were
truncated (one line per table).

We decided to do this to make the output of the tests execution cleaner
and to make it easier to find the actual results of the tests without
having to scroll down quite a bit.

We still show a message marking the stage where the tables are truncated:
`Cleaning up database...`.

[MAILPOET-4682]
2022-09-27 12:30:13 -05:00
John Oleksowicz
68b3b23e3c Assume WC is installed/activated for tests
MAILPOET-4566
2022-09-08 13:02:52 +02:00
Rostislav Wolny
16807fe9e3 Update and fix comments related to usage of Action Scheduler in cron
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
ddb63bfa9f Setup integration test to run without action scheduler cron
Action Scheduler was running in background causing random test failures.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Sam Najian
bcb7382760 Make local integration tests pick up env
[MAILPOET-4394]
2022-06-20 09:24:49 +02:00
Rodrigo Primo
c214eb4c85 Use trunk instead of master as the branch where tests cannot be skipped
[MAILPOET-3466]
2022-05-31 11:23:33 +01:00
Sam Najian
393154e080 Adjust used Docker container to run integration tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Rodrigo Primo
cf2a0eb5cc Get the list of tables to truncate when running tests dynamically
While removing some deprecated models in the commit
a525b96f16, I noticed that we maintain a
list of tables that needs to be truncated before running the integration
tests. To make it easier when removing future models and to make sure
the list of tables is always updated, in this commit, I'm removing the
manual list and changing the code to dynamically get the tables and
truncate them.

The code that I removed from _bootstrap.php, meant that PHPStan error
was not present anymore, so it was possible to update its baseline files
to remove the ignores for that error.

[MAILPOET-4325]
2022-05-16 11:33:00 +02:00
Rodrigo Primo
01f0585400 Remove three Paris models that have been deprecated over six months ago
This commit removes the models Form, NewsletterLink and
StatisticsUnsubscribes as they were deprecated over six months ago and
are not used anymore in our codebase.

[MAILPOET-4325]
2022-05-16 11:33:00 +02:00
John Oleksowicz
73c023449b Use simpler method for overriding DI properties
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
9bfe2b2ca1 Newsletter validation updates
- 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]
2022-05-16 11:17:29 +02:00
Jan Jakes
36a3f34db8 Add generic API endpoint tests
[MAILPOET-4207]
2022-04-20 15:30:50 +02:00
Jan Jakes
e79b0e6b25 Activate automation for integration tests
[MAILPOET-4207]
2022-04-20 15:30:50 +02:00
Jan Jakes
54010fe7e4 Add abstract class for REST API integration tests
[MAILPOET-4207]
2022-04-20 15:30:50 +02:00
Jan Jakes
47a234c18e Reset features controller cache in integration tests
[MAILPOET-4207]
2022-04-20 15:30:50 +02:00
Sam
fc7313d44b Revert "Revert "Fix failing tests because of un-registered product post type""
This reverts commit fbcfa6db82.
2022-04-18 11:43:47 +02:00
Rodrigo Primo
fbcfa6db82 Revert "Fix failing tests because of un-registered product post type"
This reverts commit 7854645ea4.
2022-04-11 16:30:59 -03:00
Sam Najian
7854645ea4 Fix failing tests because of un-registered product post type
Post type `product` should be registered for the post type
related functions to work correctly

[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Brezo Cordero
0854d36256 Remove \Models\SubscriberIP
[MAILPOET-3899]
2022-02-28 09:42:56 +01:00
Rostislav Wolny
a644c71e64 Add subscriber detection from Woo Session to subscriber action tracker
[MAILPOET-4101]
2022-02-16 16:06:05 +01:00
Rodrigo Primo
a48e41970c Check if MailPoet is active before running integration tests
[MAILPOET-4089]
2022-02-07 15:14:19 +01:00
Jan Lysý
d68f31f4c1 Replace using backupGlobals from PHPUnit
Because globals backup in PHPUnit 8 is slower due to
the checking if global is serializable. We used
our custom solution inspired by WC.
[MAILPOET-4053]
2022-01-19 13:14:42 +01:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00