stable

Clone or download

Read-only

refactor: extract logic to send one invitation

This reduces responsibility of InvitationSender, and will allow to add more logic in the new object. In the future the sending of an invitation might return different things according to situation (email in error, user added in project, user already in project, …). To handle separately errors and success, we use Neverthrow. No functional changes. Part of story #30021: Invite buddies to my Tuleap project Change-Id: Iacdfbac7aec103f47f7c93649e01df13321c56b0

Modified Files

Name
A src/common/InviteBuddy/InvitationCreator.php +38 −0 Go to diff View file
M src/common/InviteBuddy/InvitationDao.php +1 −1 Go to diff View file
M src/common/InviteBuddy/InvitationSender.php +15 −54 Go to diff View file
A src/common/InviteBuddy/InvitationStatusUpdater.php +30 −0 Go to diff View file
A src/common/InviteBuddy/InvitationToOneRecipientSender.php +42 −0 Go to diff View file
A src/common/InviteBuddy/InvitationToOneRecipientWithoutVerificationSender.php +106 −0 Go to diff View file
M src/common/InviteBuddy/REST/v1/InvitationsResource.php +9 −5 Go to diff View file
M src/common/Request/RouteCollector.php +9 −5 Go to diff View file
M tests/lib/Stubs/RetrieveUserByEmailStub.php +5 −1 Go to diff View file
A tests/unit/common/InviteBuddy/InvitationCreatorStub.php +58 −0 Go to diff View file
M tests/unit/common/InviteBuddy/InvitationSenderTest.php +213 −342 Go to diff View file
A tests/unit/common/InviteBuddy/InvitationStatusUpdaterStub.php +59 −0 Go to diff View file
A tests/unit/common/InviteBuddy/InvitationToOneRecipientSenderStub.php +87 −0 Go to diff View file
A tests/unit/common/InviteBuddy/InvitationToOneRecipientWithoutVerificationSenderTest.php +303 −0 Go to diff View file