$namespace = $this->matchNamespace($name);
$path = explode(':', $name);
if (empty($this->_sharedPrefix)
- || strpos($path[0], $this->_sharedPrefix) === false
- || in_array($path[0], array_keys($this->_namespaces[self::OTHER]))) {
+ || (strpos($path[0], $this->_sharedPrefix) === false
+ && !in_array($path[0], array_keys($this->_namespaces[self::OTHER])))) {
$namespace = $this->_getPrimaryPersonalNamespace();
array_unshift($path, $namespace['namespace']);
} else {
);
}
+ public function testSetnameAllowsCreatingFoldersInSharedNamespace()
+ {
+ $folder = new Horde_Kolab_Storage_Folder(null);
+ $folder->restore($this->_storage, $this->_connection, new Horde_Kolab_Storage_Namespace());
+ $folder->setName('shared.test');
+ $this->assertEquals('shared.test', $folder->getName());
+ }
+
+ public function testSetnameAllowsCreatingFoldersInOthersNamespace()
+ {
+ $folder = new Horde_Kolab_Storage_Folder(null);
+ $folder->restore($this->_storage, $this->_connection, new Horde_Kolab_Storage_Namespace());
+ $folder->setName('user:test:test');
+ $this->assertEquals('user/test/test', $folder->getName());
+ }
+
public function testFolderSubpathIsAccessibleForNewFolders()
{
$folder = new Horde_Kolab_Storage_Folder(null);