/** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { $this->_sync->updateAfterCreateFolder($folder, $type); }
public function testUpdateAfterCreateFolderWithType() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2))->method('hasNamespace')->will($this->returnValue(true)); $cache->expects($this->once())->method('getNamespace')->will($this->returnValue(serialize($namespace))); $cache->expects($this->once())->method('getFolders')->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once())->method('getFolderTypes')->will($this->returnValue(array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note'))); $cache->expects($this->once())->method('store')->with(array('INBOX/Foo', 'INBOX/Bar', 'INBOX/FooBar'), array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note', 'INBOX/FooBar' => 'note')); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization($driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail()); $list->setCache($cache); $list->updateAfterCreateFolder('INBOX/FooBar', 'note'); }