public function testModifyPreferences() { $p = new Horde_Prefs('horde', array(self::$prefs)); $p['theme'] = "barbie"; $p->store(); $this->assertEquals("barbie", $this->_readValue(self::$db->selectValue('SELECT pref_value FROM horde_prefs WHERE pref_uid = ? AND pref_scope = ? AND pref_name = ?', array('joe', 'horde', 'theme')))); }
public function testLargePreferences() { $p = new Horde_Prefs('test', array(self::$prefs, new Horde_Prefs_Stub_Storage('test'))); $value = str_repeat('x', 4001); $p['a'] = $value; $p->store(); $this->assertEquals($value, $this->_readValue(self::$db->selectValue('SELECT pref_value FROM horde_prefs WHERE pref_uid = ? AND pref_scope = ? AND pref_name = ?', array('joe', 'test', 'a')))); }
public function testCreateFolder() { $this->markTestIncomplete('The mock driver confuses user/test/Preferences with INBOX/Preferences'); setlocale(LC_MESSAGES, 'C'); $p = new Horde_Prefs('test', array(new Horde_Prefs_Storage_KolabImap('test', array('kolab' => $this->_createStorage())), new Horde_Prefs_Stub_Storage('test'))); $p['a'] = 'c'; $p->store(); $this->assertLogContains('Horde_Prefs_Storage_KolabImap: Created default Kolab preferences folder "Preferences".'); }
public function testModifyPreferences() { $storage = $this->_createDefaultStorage(); $p = new Horde_Prefs('horde', array(new Horde_Prefs_Storage_KolabImap('*****@*****.**', array('kolab' => $storage)))); $p['theme'] = 'barbie'; $p->store(); $objects = $storage->getData('INBOX/Preferences')->getObjects(); $object = array_pop($objects); $this->assertContains('theme:YmFyYmll', $object['pref']); $p->cleanup(true); }