74825[FEATURE] Add PSR-14 events for Mailer
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Oliver Klee +1
- Stefan Bürk +1
- André Buchmann +1
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Stefan Bürk +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 7
- typo3/sysext/core/Classes/Mail/Event/AfterMailerSentMessageEvent.phpnew+40 −0
- typo3/sysext/core/Classes/Mail/Event/BeforeMailerSentMessageEvent.phpnew+64 −0
- typo3/sysext/core/Classes/Mail/Mailer.php+11 −1
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-93689-PSR-14EventsOnSendingMessagesWithMailer.rst2new+92 −0
- typo3/sysext/core/Tests/Functional/Mail/MailerTest.phpnew+87 −0
- typo3/sysext/core/Tests/Unit/Mail/Event/AfterMailerSentMessageEventTest.phpnew+54 −0
- typo3/sysext/core/Tests/Unit/Mail/Event/BeforeMailerSentMessageEventTest.phpnew+87 −0
Review log 2226
Show 1 earlier messages
-
Oli Bartsch uploaded patch set 1 06/07/22, 20:48
-
Benni Mack commented on patch set 1 06/07/22, 20:49
Would be great to have tests for this -
Oli Bartsch commented on patch set 1 06/07/22, 20:57
Reply
Which kind of test do you have in mind? -
core-ci voted on patch set 1 V +1 06/07/22, 21:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27779
-
Joey Bouten voted on patch set 1 CR +1 06/08/22, 12:07
-
Oliver Klee commented on patch set 1 06/08/22, 12:25
Reply
Suggestions for tests: - for the two event classes, tests that the setters/getters pass the data around as intended - for the mailer, tests that check that the events are fired and provided with the intended data/objects -
Oli Bartsch commented on patch set 1 06/09/22, 08:56
Reply
Thanks for the suggestions. Could you please describe the benefit in testing type hinted setters and getters for their passed data? Those methods do not contain any additional functionality which could be tested, so only the types could be tested, which as said are type hinted. -
Oliver Klee commented on patch set 1 06/09/22, 09:18
Reply
Type annotations are also code, and that code could be wrong. (In other words, the tests serve as a kind of "double bookkeeping", and if we rely on the type annotations alone, we reduce this to single bookkeeping.) In addition, the getter and setter methods have code that could be incorrect. For example, the type annotations would have no problem with an empty setter, or with a setter with a typo in the property name, or with a getter always returning a new instance. In addition, if something breaks, it is helpful to know whether the getters and setters are reliable so we can rule them out as the cause of the problem. -
Benni Mack commented on patch set 1 06/09/22, 15:39
Reply
So, should this be Unit Tests or Functional Tests? -
Oliver Klee commented on patch set 1 06/09/22, 16:01
Reply
The tests for the event classes themselves should be unit tests. The tests for the mailer should preferably be unit tests (if we can get this to work), and otherwise functional tests. -
Oli Bartsch uploaded patch set 2 06/10/22, 15:16
-
Oli Bartsch commented on patch set 2 06/10/22, 15:17
Reply
Done -
core-ci voted on patch set 2 V -1 06/10/22, 15:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27931
-
Oli Bartsch uploaded patch set 3 06/10/22, 15:34
-
core-ci voted on patch set 3 V +1 06/10/22, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27933
-
Simon Schaufelberger commented on patch set 3 06/10/22, 17:31
could this conflict with https://review.typo3.org/c/Packages/TYPO3.CMS/+/74853 somehow? -
André Buchmann commented on patch set 3 CR -1 06/11/22, 19:02
Feature-93689-PSR-14EventsOnSendingMessagesWithMailer.rst:88I think there should be no comma between "messages" and "before". Second sentence contains duplicate "has". Suggestion: With the new PSR-14 events, it's now possible to manipulate messages before they are sent by the mailer. Additionally, after the mailer has sent messages, further processing can be performed. -
Oli Bartsch uploaded patch set 4 06/13/22, 06:44
-
Oli Bartsch commented on patch set 4 06/13/22, 06:45
Reply
No, does not conflict.Feature-93689-PSR-14EventsOnSendingMessagesWithMailer.rst:88ReplyDone -
core-ci voted on patch set 4 V +1 06/13/22, 06:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28000
-
André Buchmann voted on patch set 4 CR +1 06/13/22, 07:19
-
Oliver Klee voted on patch set 4 CR +1 06/13/22, 11:35
-
Benni Mack voted on patch set 4 V +1 CR +1 06/13/22, 11:46
-
Stefan Bürk voted on patch set 4 V +1 CR +1 06/13/22, 15:21
-
Oli Bartsch voted on patch set 4 V +2 CR +2 06/13/22, 19:10
-
Oli Bartsch merged patch set 5 06/13/22, 19:10