updateAfterRenameFolder() public method

Update the listener after renaming a folder.
public updateAfterRenameFolder ( string $old, string $new ) : null
$old string The old path of the folder.
$new string The new path of the folder.
return null
Beispiel #1
0
 /**
  * Update the listener after renaming a folder.
  *
  * @param string $old The old path of the folder.
  * @param string $new The new path of the folder.
  *
  * @return NULL
  */
 public function updateAfterRenameFolder($old, $new)
 {
     $this->_sync->updateAfterRenameFolder($old, $new);
 }
 public function testUpdateAfterRenameFolder()
 {
     $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(0 => 'INBOX/Foo', 2 => 'INBOX/FooBar'), array('INBOX/Foo' => 'contact', '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->updateAfterRenameFolder('INBOX/Bar', 'INBOX/FooBar');
 }