-
Notifications
You must be signed in to change notification settings - Fork 262
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
b9a0733
commit b0593d8
Showing
2 changed files
with
18 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,11 @@ class IMipServiceTest extends TestCase { | |
protected function setUp(): void { | ||
parent::setUp(); | ||
|
||
// iMIP is NC25+ | ||
if (!method_exists(IManager::class, 'handleImipReply')) { | ||
// iMip Request is NC31+ | ||
if (!method_exists(IManager::class, 'handleImipRequest')) { | ||
self::markTestIncomplete(); | ||
} | ||
|
||
|
||
$this->accountService = $this->createMock(AccountService::class); | ||
$this->calendarManager = $this->createMock(IManager::class); | ||
$this->mailboxMapper = $this->createMock(MailboxMapper::class); | ||
|
@@ -252,9 +251,10 @@ public function testIsRequest(): void { | |
$mailAccount = new MailAccount(); | ||
$mailAccount->setId(200); | ||
$mailAccount->setEmail('[email protected]'); | ||
$mailAccount->setUserId('vincent'); | ||
$account = new Account($mailAccount); | ||
$imapMessage = $this->createMock(IMAPMessage::class); | ||
$imapMessage->scheduling[] = ['method' => 'REQUEST']; | ||
$imapMessage->scheduling[] = ['method' => 'REQUEST', 'contents' => 'VCALENDAR']; | ||
$addressList = $this->createMock(AddressList::class); | ||
$address = $this->createMock(Address::class); | ||
|
||
|
@@ -282,15 +282,17 @@ public function testIsRequest(): void { | |
->willReturn($address); | ||
$address->expects(self::once()) | ||
->method('getEmail') | ||
->willReturn('pam@stardew-bus-company.com'); | ||
->willReturn('pam@stardew-bus-service.com'); | ||
$this->logger->expects(self::never()) | ||
->method('info'); | ||
$this->calendarManager->expects(self::never()) | ||
->method('handleIMipReply'); | ||
$this->calendarManager->expects(self::never()) | ||
->method('handleIMipCancel'); | ||
$this->messageMapper->expects(self::never()) | ||
->method('updateBulk'); | ||
$this->calendarManager->expects(self::once()) | ||
->method('handleIMipRequest') | ||
->with('principals/users/vincent', | ||
'[email protected]', | ||
$account->getEmail(), | ||
$imapMessage->scheduling[0]['contents']); | ||
$this->messageMapper->expects(self::once()) | ||
->method('updateImipData'); | ||
|
||
$this->service->process(); | ||
} | ||
|
@@ -349,8 +351,6 @@ public function testIsReply(): void { | |
'[email protected]', | ||
$account->getEmail(), | ||
$imapMessage->scheduling[0]['contents']); | ||
$this->calendarManager->expects(self::never()) | ||
->method('handleIMipCancel'); | ||
$this->messageMapper->expects(self::once()) | ||
->method('updateImipData'); | ||
|
||
|