diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-04-19 11:13:35 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-04-19 11:13:35 +0300 |
commit | 79198f8375f26425b2b9395a7014c3ffc6881583 (patch) | |
tree | 899699ba6b6a2473405ec665c267c0ed26ddc8c1 /tests/Service | |
parent | 36ed424ed6aae5d67829aacc04edf48d54e0d501 (diff) |
Make it possible to create subfolders and show folder stats
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/Service')
-rw-r--r-- | tests/Service/MailManagerTest.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/Service/MailManagerTest.php b/tests/Service/MailManagerTest.php index 03e28c1e3..9d144a340 100644 --- a/tests/Service/MailManagerTest.php +++ b/tests/Service/MailManagerTest.php @@ -26,6 +26,7 @@ use Horde_Imap_Client_Socket; use OCA\Mail\Account; use OCA\Mail\Folder; use OCA\Mail\IMAP\FolderMapper; +use OCA\Mail\IMAP\FolderStats; use OCA\Mail\IMAP\IMAPClientFactory; use OCA\Mail\IMAP\MessageMapper; use OCA\Mail\IMAP\Sync\Request; @@ -48,7 +49,7 @@ class MailManagerTest extends TestCase { /** @var Synchronizer|MockObject */ private $sync; - /** @varr MailManager */ + /** @var MailManager */ private $manager; protected function setUp() { @@ -114,6 +115,23 @@ class MailManagerTest extends TestCase { $this->assertEquals($folder, $created); } + public function testGetFolderStats() { + $client = $this->createMock(Horde_Imap_Client_Socket::class); + $account = $this->createMock(Account::class); + $this->imapClientFactory->expects($this->once()) + ->method('getClient') + ->willReturn($client); + $stats = $this->createMock(FolderStats::class); + $this->folderMapper->expects($this->once()) + ->method('getFoldersStatusAsObject') + ->with($this->equalTo($client), $this->equalTo('INBOX')) + ->willReturn($stats); + + $actual = $this->manager->getFolderStats($account, 'INBOX'); + + $this->assertEquals($stats, $actual); + } + public function testSync() { $account = $this->createMock(Account::class); $syncRequest = $this->createMock(Request::class); |