-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Lost update between last draft and sending a message
Signed-off-by: hamza221 <[email protected]>
- Loading branch information
Showing
6 changed files
with
25 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -373,54 +373,6 @@ public function testConvertToOutboxMessage(): void { | |
$this->draftsService->updateMessage($account, $message, $to, $cc, $bcc, $attachments); | ||
} | ||
|
||
public function testConvertToOutboxMessageNoRecipients(): void { | ||
$message = new LocalMessage(); | ||
$message->setId(10); | ||
$message->setAccountId(1); | ||
$message->setSendAt($this->time->getTime()); | ||
$message->setSubject('Test'); | ||
$message->setBody('Test Test Test'); | ||
$message->setHtml(true); | ||
$message->setInReplyToMessageId('abcd'); | ||
$message->setType(LocalMessage::TYPE_OUTGOING); | ||
$old = Recipient::fromParams([ | ||
'label' => 'Pam', | ||
'email' => '[email protected]', | ||
'type' => Recipient::TYPE_TO, | ||
]); | ||
$message->setRecipients([$old]); | ||
$to = []; | ||
$cc = []; | ||
$bcc = []; | ||
$attachments = [['type' => '']]; | ||
$attachmentIds = [3]; | ||
$message2 = $message; | ||
$message2->setRecipients([]); | ||
$account = $this->createConfiguredMock(Account::class, [ | ||
'getUserId' => $this->userId | ||
]); | ||
$client = $this->createMock(\Horde_Imap_Client_Socket::class); | ||
|
||
$this->mapper->expects(self::never()) | ||
->method('updateWithRecipients') | ||
->with($message, [], $cc, $bcc) | ||
->willReturn($message2); | ||
$this->clientFactory->expects(self::never()) | ||
->method('getClient') | ||
->with($account) | ||
->willReturn($client); | ||
$this->attachmentService->expects(self::never()) | ||
->method('handleAttachments') | ||
->with($account, $attachments, $client) | ||
->willReturn($attachmentIds); | ||
$this->attachmentService->expects(self::never()) | ||
->method('updateLocalMessageAttachments') | ||
->with($this->userId, $message2, $attachmentIds); | ||
|
||
$this->expectException(ClientException::class); | ||
$this->draftsService->updateMessage($account, $message, $to, $cc, $bcc, $attachments); | ||
} | ||
|
||
public function testUpdateMessageNoAttachments(): void { | ||
$message = new LocalMessage(); | ||
$message->setId(10); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters