public function testSslGetterAndSetter()
 {
     $origin = new UserEmailOrigin();
     $this->assertNull($origin->getImapEncryption());
     $origin->setImapEncryption('test');
     $this->assertEquals('test', $origin->getImapEncryption());
 }
 /**
  * Create object of AccountTypeModel using data of form
  *
  * @param array $data
  *
  * @return AccountTypeModel|null
  */
 protected function createAccountTypeModelFromData($data)
 {
     $imapGmailConfiguration = isset($data['userEmailOrigin']) ? $data['userEmailOrigin'] : [];
     if (empty($imapGmailConfiguration['user'])) {
         return null;
     }
     $accountTypeModel = new AccountTypeModel();
     $accountTypeModel->setAccountType($data['accountType']);
     $userEmailOrigin = new UserEmailOrigin();
     $userEmailOrigin->setImapHost($imapGmailConfiguration['imapHost']);
     $userEmailOrigin->setImapPort($imapGmailConfiguration['imapPort']);
     $userEmailOrigin->setImapEncryption($imapGmailConfiguration['imapEncryption']);
     $userEmailOrigin->setUser($imapGmailConfiguration['user']);
     if (!empty($imapGmailConfiguration['accessTokenExpiresAt'])) {
         $newExpireDate = $imapGmailConfiguration['accessTokenExpiresAt'];
         if (!$newExpireDate instanceof \Datetime) {
             $utcTimeZone = new \DateTimeZone('UTC');
             $accessTokenExpiresAt = $imapGmailConfiguration['accessTokenExpiresAt'];
             $newExpireDate = new \DateTime('+' . $accessTokenExpiresAt . ' seconds', $utcTimeZone);
         }
         $userEmailOrigin->setAccessTokenExpiresAt($newExpireDate);
     }
     $accountTypeModel->setUserEmailOrigin($userEmailOrigin);
     return $accountTypeModel;
 }