protected function createCachedStorage($driver = null, $factory = null)
{
$factory = $this->completeFactory($factory);
if ($driver === null) {
$driver = new Horde_Kolab_Storage_Driver_Mock($factory, array('username' => 'test', 'host' => 'localhost', 'port' => 143));
}
$cache = $this->getMockCache();
return new Horde_Kolab_Storage_Cached($driver, new Horde_Kolab_Storage_QuerySet_Cached($factory, array(), $cache), $factory, $cache, $this->getMock('Horde_Log_Logger'));
}