Jan Jakes
76d2d40198
Add missing exception message
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
8c2377b0f9
Fix trigger tests for new data structures & simplify them
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
d911166637
Use new data structures in someone subscribes trigger & simplify it
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
5920810ac6
Use step args for triggers
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
a7a58ee791
Fix typos and variable name
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
3c651c940b
Add convenience by-class getter for payloads (& use it)
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
a35e925479
Add convenience by-class getter for subjects
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
fe3d719a13
Use step run args in existing actions
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
68b5bab9cc
Introduce step run args to simplify step run arguments
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
460cbd9e12
Construct and pass subject entries to step runners
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
00e8c4f3e5
Make steps specify required/provided subject keys
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
c28d8ad79c
Introduce subject entry to carry subject & payload data
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
b0aad2216a
Split subscriber subject to Subject & Payload
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
18aedf3d1a
Split segment subject to Subject & Payload
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
e38e79f385
Split integration subject to a service (Subject) and data (Payload)
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
757f1dc01a
Use subject data type for workflow runs, remove subject loading from storage
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
c30244b30f
Introduce subject data type for storage
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
c58a5a4308
Add workflow step arg schema validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
282c987d4f
Require root step by workflow schema
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
d7b65bd980
Run validation on workflow create and update
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
e220b70c78
Add workflow validator service with workflow graph validation rules
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
a3ea91adae
Add no split rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
65927cc281
Add no join rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
cafe2ed8a7
Add no cycle rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
a3797b976a
Add triggers under root rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
325418e826
Add no duplicate edges rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
11a711e42c
Add consisten steps map rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
0aa4cd4863
Add no unreachable steps rule for workflow validation
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
e472c00b1c
Implerment depth-first pre-order workflow graph walker with plug-in node visitors
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
e3668a8187
Add constant for root step type
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
Jan Jakes
8590cb1409
Rename automation "Validators" namespace to a more universal "Validation"
...
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
David Remer
a1775dd010
Delete user properly in multisite environment
...
[MAILPOET-4666]
2022-09-22 10:37:25 +02:00
Rodrigo Primo
2c159b1694
Document the types of two SendingQueue properties that were undocumented
...
It was also necessary to add an if condition to check the type of a
variable before calling one of the methods of one of the documented
properties.
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
f578f3f16a
Remove method Tasks\Newsletter\getNewsletterSegments()
...
This method was used only once inside SendingQueue and it can be
replaced by NewsletterEntity::getSegmentIds() to simplify the code.
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
686ee18d16
Replace calls to assert() with Assert::assertInstanceOf()
...
Doing this as it was mentioned in the review process of the PR.
For more context see: https://wp.me/pcNwfB-wR
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
d79cecbef2
Replace some of the uses of SendingQueue model with Doctrine
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
ccbdbd3e93
Refactor getNewsletterFromQueue() to use Doctrine instead of Paris
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
4ca656a217
Rename $queue to $sendingTask
...
Doing this for consistency and to make it more clear that $sendingTask
contains an instance of \MailPoet\Tasks\Sending and not an instance of
\MailPoet\Models\SendingQueue.
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
a7d0ad6568
Set the type of all the Newsletter parameters that use the Sending class
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
3b9a60c039
Rename NewsletterTest::queue to NewsletterTest::sendingTask
...
Doing this for consistency and to better makr that this property
contains an instance of \MailPoet\Tasks\Sending and not an instance
of \MailPoet\Models\SendingQueue.
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
168ce20a40
Use NewsletterEntity instead of Newsletter model in Links
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
9a92068d5b
Refactor Newsletter to use Doctrine instead of the Newsletter model
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
f6afe987c8
Add return type declaration for Newsletter::prepareNewsletterForSending()
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
68c3277195
Replace Subscriber model with Doctrine in Tasks\Newsletter
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
fd0acbd6cf
Refactor Newsletter to use Doctrine instead of the NewsletterSegment model
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
f4053b0583
Stop using a mock of NewslettersRepository to prevent errors in tests
...
This commit changes the SendingQueueTest test class to always use a real
NewslettersRepository object instead of a mock object when instantiating
SendingQueue. This is necessary to prevent false errors in the tests.
Using a mock of the NewslettersRepository in this test class means that
all code inside SendingQueue that uses this repository could behave in
unpredictable ways. As it was happening with a few tests incorrectly
failing after dd6e02e2c16a3a0ef7ad2c12479917e33c312c77:
https://app.circleci.com/pipelines/github/mailpoet/mailpoet/11132/workflows/7b4df151-5a10-48f0-9711-dd590a764880/jobs/192389/tests#failed-test-0
In this case, the code was not changing the status of the newsletter
because findOneById() was returning an empty Newsletter entity instead
of the real Newsletter entity that corresponds to the object in the
database. And, thus, $newsletter->getType() was returning `null` instead
of `standard`.
This problem was already partially addressed in the commit below that
removed some of the usages of the NewslettersRepository mock:
5042cdd15e
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
05664a0c6a
Refactor markNewsletterAsSent() to use Doctrine instead of Paris
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
a4bb49852d
Replace Subscriber model with Doctrine in NewsletterTest
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
2137503e09
Replace NewsletterSegment model with Doctrine in NewsletterTest
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
Rodrigo Primo
9bf025874c
Replace SendingQueue model with Doctrine in NewsletterTest
...
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00