/**
  * test change pw + credential cache
  */
 public function testChangePasswordAndUpdateCredentialCache()
 {
     $this->markTestSkipped('FIXME 0009250: fix test testChangePasswordAndUpdateCredentialCache');
     $testConfig = Zend_Registry::get('testConfig');
     $account = clone $this->_account;
     unset($account->id);
     $account->type = Felamimail_Model_Account::TYPE_USER;
     $account->user = $testConfig->username;
     $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
     if (isset($imapConfig['domain']) && !empty($imapConfig['domain'])) {
         $account->user .= '@' . $imapConfig['domain'];
     }
     $account->password = $testConfig->password;
     $account = $this->_controller->create($account);
     $testPw = 'testpwd';
     // change pw & update credential cache
     $this->_setCredentials($testConfig->username, $testPw);
     $account = $this->_controller->get($account->getId());
     // try to connect to imap
     $loginSuccessful = TRUE;
     try {
         $imap = Felamimail_Backend_ImapFactory::factory($account);
     } catch (Felamimail_Exception_IMAPInvalidCredentials $e) {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' config: ' . print_r($imapAccountConfig, true) . ' / exception:' . $e);
         }
         $loginSuccessful = FALSE;
     }
     $this->assertTrue($loginSuccessful, 'wrong credentials');
 }
 /**
  * test change pw + credential cache
  */
 public function testChangePasswordAndUpdateCredentialCache()
 {
     $testConfig = Zend_Registry::get('testConfig');
     $account = clone $this->_account;
     unset($account->id);
     $account->type = Expressomail_Model_Account::TYPE_USER;
     $account->user = $testConfig->username;
     $imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
     if (isset($imapConfig['domain']) && !empty($imapConfig['domain'])) {
         $account->user .= '@' . $imapConfig['domain'];
     }
     $account->password = $testConfig->password;
     $account = $this->_controller->create($account);
     $testPw = 'testpwd';
     // change pw & update credential cache
     $this->_setCredentials($testConfig->username, $testPw);
     $account = $this->_controller->get($account->getId());
     // try to connect to imap
     $loginSuccessful = TRUE;
     try {
         $imap = Expressomail_Backend_ImapFactory::factory($account);
         $imapAccountConfig = $account->getImapConfig();
         $imap->connectAndLogin((object) $imapAccountConfig);
     } catch (Expressomail_Exception_IMAPInvalidCredentials $e) {
         $loginSuccessful = FALSE;
     }
     $this->assertTrue($loginSuccessful, 'wrong credentials');
 }