/** * testGetRegistryData * * @see 0010251: do not send unused config data to client */ public function testGetRegistryData() { $regData = $this->_json->getRegistryData(); $this->assertFalse(isset($regData['defaults'])); $supportedFlags = Felamimail_Config::getInstance()->featureEnabled(Felamimail_Config::FEATURE_TINE20_FLAG) ? 6 : 5; $this->assertEquals($supportedFlags, $regData['supportedFlags']['totalcount']); }
/** * sieve test helper * * @param array $_sieveData * @return array */ protected function _sieveTestHelper($_sieveData, $_isMime = FALSE) { $this->_setTestScriptname(); // check which save fn to use if (array_key_exists('reason', $_sieveData)) { $resultSet = $this->_json->saveVacation($_sieveData); $this->assertEquals($this->_account->email, $resultSet['addresses'][0]); $_sieveBackend = Expressomail_Backend_SieveFactory::factory($this->_account->getId()); if (preg_match('/dbmail/i', $_sieveBackend->getImplementation())) { $translate = Tinebase_Translation::getTranslation('Felamimail'); $this->assertEquals(sprintf($translate->_('Out of Office reply from %1$s'), Tinebase_Core::getUser()->accountFullName), $resultSet['subject']); } else { $this->assertEquals($_sieveData['subject'], $resultSet['subject']); } if ($_isMime) { $this->assertEquals(html_entity_decode('unittest vacation message', ENT_NOQUOTES, 'UTF-8'), $resultSet['reason']); } else { $this->assertEquals($_sieveData['reason'], $resultSet['reason']); } } else { if (array_key_exists('action_type', $_sieveData[0])) { $resultSet = $this->_json->saveRules($this->_account->getId(), $_sieveData); $this->assertEquals($_sieveData, $resultSet); } } return $resultSet; }
/** * testGetRegistryData * * @see 0010251: do not send unused config data to client */ public function testGetRegistryData() { $regData = $this->_json->getRegistryData(); $this->assertFalse(isset($regData['defaults'])); $this->assertEquals(5, $regData['supportedFlags']['totalcount']); }
/** * testDisabledExternalImip */ public function testDisabledExternalImip() { Calendar_Config::getInstance()->set(Calendar_Config::DISABLE_EXTERNAL_IMIP, true); $complete = $this->_addImipMessageToEmailCache(); $fmailJson = new Felamimail_Frontend_Json(); $jsonMessage = $fmailJson->getMessage($complete->getId()); Calendar_Config::getInstance()->set(Calendar_Config::DISABLE_EXTERNAL_IMIP, false); $this->assertEmpty($jsonMessage['preparedParts']); }