Skip to content
Snippets Groups Projects
Commit 0749b56b authored by Yih Yang's avatar Yih Yang Committed by Christoph Wurst
Browse files

Remove \OCA\Mail\Account::createMailbox (#2056)


- Removed createMailbox() and getMailbox() from OCA\Mail\Account
- Replaced existing test on Account with getTestAccount from
  OCA\Mail\Tests\IMAP\AbstractTest

Signed-off-by: default avatarYih Yang <yyngo788n88@hotmail.com>
parent a9c6f0c3
No related branches found
No related tags found
No related merge requests found
......@@ -150,18 +150,6 @@ class Account implements JsonSerializable {
return $this->client;
}
/**
* @param string $mailBox
* @param array $opts
* @return Mailbox
*/
public function createMailbox($mailBox, $opts = []) {
$conn = $this->getImapConnection();
$conn->createMailbox($mailBox, $opts);
return $this->getMailbox($mailBox);
}
/**
* @param string $mailBox
*/
......
......@@ -35,10 +35,12 @@ class AccountTest extends AbstractTest {
*/
public function testCreateAndDelete($name) {
$name = uniqid($name);
$this->createMailBox($name);
$imapConnection = $this->getTestAccount()->getImapConnection();
$imapConnection->createMailBox($name);
$this->assertMailBoxExists($name);
$this->getTestAccount()->deleteMailbox($name);
$imapConnection->deleteMailbox($name);
$this->assertMailBoxNotExists($name);
}
......@@ -49,25 +51,4 @@ class AccountTest extends AbstractTest {
['äöü']
];
}
/**
* @dataProvider providesMailBoxNames
* @param $name
*/
public function testListMessages($name) {
$name = uniqid($name);
$newMailBox = parent::createMailBox($name);
$count = $newMailBox->getTotalMessages();
$this->assertEquals(0, $count);
$messages = $newMailBox->getMessages();
$this->assertInternalType('array', $messages);
$this->assertEquals(0, count($messages));
$this->createTestMessage($newMailBox);
$count = $newMailBox->getTotalMessages();
$this->assertEquals(1, $count);
$messages = $newMailBox->getMessages();
$this->assertInternalType('array', $messages);
$this->assertEquals(1, count($messages));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment