-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: SebastianKrupinski <[email protected]>
- Loading branch information
1 parent
3ef1f9f
commit 5053bf3
Showing
5 changed files
with
76 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,8 +88,8 @@ public function findByUserId(string $userId): array { | |
* | ||
* @since 4.0.0 | ||
* | ||
* @param string $userId system user id | ||
* @param string $address mail address (e.g. [email protected]) | ||
* @param string $userId system user id | ||
* @param string $address mail address (e.g. [email protected]) | ||
* | ||
* @return MailAccount[] | ||
* | ||
|
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 |
---|---|---|
|
@@ -83,8 +83,8 @@ public function findById(int $id): Account { | |
* | ||
* @since 4.0.0 | ||
* | ||
* @param string $userId system user id | ||
* @param string $address mail address (e.g. [email protected]) | ||
* @param string $userId system user id | ||
* @param string $address mail address (e.g. [email protected]) | ||
* | ||
* @return Account[] | ||
* | ||
|
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 |
---|---|---|
|
@@ -26,17 +26,17 @@ | |
|
||
class MessageSendTest extends TestCase { | ||
|
||
/** @var IConfig&MockObject*/ | ||
/** @var IConfig&MockObject */ | ||
private $config; | ||
/** @var ITimeFactory&MockObject*/ | ||
/** @var ITimeFactory&MockObject */ | ||
private $time; | ||
/** @var AccountService&MockObject*/ | ||
/** @var AccountService&MockObject */ | ||
private $accountService; | ||
/** @var OutboxService&MockObject*/ | ||
/** @var OutboxService&MockObject */ | ||
private $outboxService; | ||
/** @var AttachmentService&MockObject*/ | ||
/** @var AttachmentService&MockObject */ | ||
private $attachmentService; | ||
/** @var AccountService&MockObject*/ | ||
/** @var AccountService&MockObject */ | ||
private $commandSend; | ||
|
||
protected function setUp(): void { | ||
|
@@ -110,12 +110,12 @@ public function testPerformWithAttachment(): void { | |
$localAttachmentReturned = LocalAttachment::fromParams($localAttachmentReturned); | ||
// define attachment service returns | ||
$this->attachmentService->expects($this->once())->method('addFileFromString') | ||
->with( | ||
'user1', | ||
$this->mailAttachment->getName(), | ||
$this->mailAttachment->getType(), | ||
$this->mailAttachment->getContents() | ||
)->willReturn($localAttachmentReturned); | ||
->with( | ||
'user1', | ||
$this->mailAttachment->getName(), | ||
$this->mailAttachment->getType(), | ||
$this->mailAttachment->getContents() | ||
)->willReturn($localAttachmentReturned); | ||
// construct mail app message objects | ||
$localMessageFresh = $this->localMessageData; | ||
$localMessageFresh['sendAt'] = $this->time->getTime($localMessageFresh); | ||
|
@@ -127,14 +127,14 @@ public function testPerformWithAttachment(): void { | |
$localMessageReturned = LocalMessage::fromParams($localMessageReturned); | ||
// define attachment service returns | ||
$this->outboxService->expects($this->once())->method('saveMessage') | ||
->with( | ||
$this->localAccount, | ||
$localMessageFresh, | ||
[['email' => '[email protected]', 'label' => 'User Two']], | ||
[], | ||
[], | ||
[$localAttachmentReturned->jsonSerialize()] | ||
)->willReturn($localMessageReturned); | ||
->with( | ||
$this->localAccount, | ||
$localMessageFresh, | ||
[['email' => '[email protected]', 'label' => 'User Two']], | ||
[], | ||
[], | ||
[$localAttachmentReturned->jsonSerialize()] | ||
)->willReturn($localMessageReturned); | ||
// construct mail provider message with attachment | ||
$mailMessage = $this->mailMessage; | ||
$mailMessage->setAttachments($this->mailAttachment); | ||
|
@@ -162,14 +162,14 @@ public function testPerformWithOutAttachment(): void { | |
$localMessageReturned = LocalMessage::fromParams($localMessageReturned); | ||
// define attachment service returns | ||
$this->outboxService->expects($this->once())->method('saveMessage') | ||
->with( | ||
$this->localAccount, | ||
$localMessageFresh, | ||
[['email' => '[email protected]', 'label' => 'User Two']], | ||
[], | ||
[], | ||
[] | ||
)->willReturn($localMessageReturned); | ||
->with( | ||
$this->localAccount, | ||
$localMessageFresh, | ||
[['email' => '[email protected]', 'label' => 'User Two']], | ||
[], | ||
[], | ||
[] | ||
)->willReturn($localMessageReturned); | ||
// construct mail provider message | ||
$mailMessage = $this->mailMessage; | ||
// test send message | ||
|
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 |
---|---|---|
|
@@ -20,9 +20,9 @@ | |
|
||
class MailProviderTest extends TestCase { | ||
|
||
/** @var ContainerInterfaceMockObject*/ | ||
/** @var ContainerInterfaceMockObject */ | ||
private $containerInterface; | ||
/** @var AccountServiceMockObject*/ | ||
/** @var AccountServiceMockObject */ | ||
private $accountService; | ||
|
||
protected function setUp(): void { | ||
|
@@ -69,16 +69,16 @@ public function testHasServices(): void { | |
])); | ||
// define account services find | ||
$this->accountService | ||
->expects($this->any()) | ||
->method('findByUserId') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', []], | ||
['user1', [100 => $mailAccount]] | ||
] | ||
) | ||
); | ||
->expects($this->any()) | ||
->method('findByUserId') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', []], | ||
['user1', [100 => $mailAccount]] | ||
] | ||
) | ||
); | ||
// construct mail provider | ||
$mailProvider = new MailProvider($this->containerInterface, $this->accountService); | ||
// test result with no services found | ||
|
@@ -114,16 +114,16 @@ public function testListServices(): void { | |
); | ||
// define account services find | ||
$this->accountService | ||
->expects($this->any()) | ||
->method('findByUserId') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', []], | ||
['user1', [$mailAccount]] | ||
] | ||
) | ||
); | ||
->expects($this->any()) | ||
->method('findByUserId') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', []], | ||
['user1', [$mailAccount]] | ||
] | ||
) | ||
); | ||
// construct mail provider | ||
$mailProvider = new MailProvider($this->containerInterface, $this->accountService); | ||
// test result with no services found | ||
|
@@ -159,16 +159,16 @@ public function testFindServiceById(): void { | |
); | ||
// define account services find | ||
$this->accountService | ||
->expects($this->any()) | ||
->method('find') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', 100, $this->throwException(new ClientException())], | ||
['user1', 100, $mailAccount] | ||
] | ||
) | ||
); | ||
->expects($this->any()) | ||
->method('find') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', 100, $this->throwException(new ClientException())], | ||
['user1', 100, $mailAccount] | ||
] | ||
) | ||
); | ||
// construct mail provider | ||
$mailProvider = new MailProvider($this->containerInterface, $this->accountService); | ||
// test result with no services found | ||
|
@@ -204,16 +204,16 @@ public function testFindServiceByAddress(): void { | |
); | ||
// define account services find | ||
$this->accountService | ||
->expects($this->any()) | ||
->method('findByUserIdAndAddress') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', '[email protected]', $this->throwException(new ClientException())], | ||
['user1', '[email protected]', [$mailAccount]] | ||
] | ||
) | ||
); | ||
->expects($this->any()) | ||
->method('findByUserIdAndAddress') | ||
->will( | ||
$this->returnValueMap( | ||
[ | ||
['user0', '[email protected]', $this->throwException(new ClientException())], | ||
['user1', '[email protected]', [$mailAccount]] | ||
] | ||
) | ||
); | ||
// construct mail provider | ||
$mailProvider = new MailProvider($this->containerInterface, $this->accountService); | ||
// test result with no services found | ||
|
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