public function __construct(IMAP $imap, $name) { $this->imap = $imap; $this->connection = $imap->getConnection(); $this->name = $name; $this->fullName = $this->imap->reopen($name); $this->mailLocalStorage = new MailboxMailLocalStorageMock(); }
private function imap(Account $account) { $this->completeAccountWithPassword($account); $imap = new IMAP($account->getImapUsername(), $account->getImapPassword()); $imap->setHost($account->getImapHost()); $imap->setPort($account->getImapPort()); $imap->setSecurity($account->getImapSecurity()); $imap->setValidateCertificate($account->getImapSecurity()); $imap->open(); return $imap; }