*/
public function getNamespace()
{
+ return $this->_driver->getNamespace();
}
/**
*/
public function getNamespace()
{
+ $this->_logger->info(
+ sprintf('Driver "%s": Retrieving namespaces.', $this->getDriverName())
+ );
+ $result = parent::getNamespace();
+ $this->_logger->info(
+ sprintf(
+ 'Driver "%s": Retrieved namespaces [%s].',
+ $this->getDriverName(),
+ (string) $result
+ )
+ );
+ return $result;
}
/**
*/
public function getNamespace()
{
+ $this->_timer->push();
+ $result = parent::getNamespace();
+ $this->_logger->info(
+ sprintf(
+ 'REQUEST OUT IMAP: %s ms [getNamespace]',
+ floor($this->_timer->pop() * 1000)
+ )
+ );
+ return $result;
}
/**
{
return key($this->_namespaces) !== null;
}
+
+ /**
+ * Convert the namespace description to a string.
+ *
+ * @return string The namespace description.
+ */
+ public function __toString()
+ {
+ return get_class($this) . ': ' . join(', ', $this->_namespaces);
+ }
}
\ No newline at end of file
return join($path, $this->_delimiter);
}
+ /**
+ * Convert the namespace description to a string.
+ *
+ * @return string The namespace description.
+ */
+ public function __toString()
+ {
+ return '"' . $this->_name . '" (' . $this->getType() . ', "' . $this->_delimiter . '")';
+ }
}
\ No newline at end of file
$driver->listAnnotation('/shared/vendor/kolab/folder-type');
$this->assertLogContains('Driver "Horde_Kolab_Storage_Driver_Mock": List contained 4 folder annotations.');
}
+
+ public function testGetNamespaceLogsEntry()
+ {
+ $driver = new Horde_Kolab_Storage_Driver_Decorator_Log(
+ $this->getNullMock(),
+ $this->getMockLogger()
+ );
+ $driver->getNamespace();
+ $this->assertLogCount(2);
+ }
+
+ public function testGetNamespaceType()
+ {
+ $driver = new Horde_Kolab_Storage_Driver_Decorator_Log(
+ $this->getNullMock(),
+ $this->getMockLogger()
+ );
+ $this->assertInstanceOf(
+ 'Horde_Kolab_Storage_Folder_Namespace',
+ $driver->getNamespace()
+ );
+ }
+
}
$driver->listAnnotation('/shared/vendor/kolab/folder-type');
$this->assertLogRegExp('/REQUEST OUT IMAP:.*listAnnotation.*/');
}
+
+ public function testGetNamespaceLogsEntry()
+ {
+ $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer(
+ $this->getTwoFolderMock(),
+ new Horde_Support_Timer(),
+ $this->getMockLogger()
+ );
+ $driver->getNamespace();
+ $this->assertLogRegExp('/REQUEST OUT IMAP:.*getNamespace.*/');
+ }
+
+ public function testGetNamespaceType()
+ {
+ $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer(
+ $this->getTwoFolderMock(),
+ new Horde_Support_Timer(),
+ $this->getMockLogger()
+ );
+ $this->assertInstanceOf(
+ 'Horde_Kolab_Storage_Folder_Namespace',
+ $driver->getNamespace()
+ );
+ }
}
}
}
+ public function testToString()
+ {
+ $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test@example.com');
+ $this->assertEquals(
+ 'Horde_Kolab_Storage_Folder_Namespace_Fixed: "INBOX" (personal, "/"), "user" (other, "/"), "" (shared, "/")',
+ (string) $namespace
+ );
+ }
+
private function _getFolder($name, $namespace)
{
$this->_connection->expects($this->any())