);
}
+ public function testListAnnotationReturnsArray()
+ {
+ $this->assertType(
+ 'array',
+ $this->getNullMock()->listAnnotation(
+ '/shared/vendor/kolab/folder-type'
+ )
+ );
+ }
+
+ public function testListAnnotationSize()
+ {
+ $this->assertEquals(
+ 4,
+ count(
+ $this->getAnnotatedMock()->listAnnotation(
+ '/shared/vendor/kolab/folder-type'
+ )
+ )
+ );
+ }
+
+ public function testListAnnotationKeys()
+ {
+ $this->assertEquals(
+ array('INBOX/Calendar', 'INBOX/Contacts', 'INBOX/Notes', 'INBOX/Tasks'),
+ array_keys(
+ $this->getAnnotatedMock()->listAnnotation(
+ '/shared/vendor/kolab/folder-type'
+ )
+ )
+ );
+ }
+
+ public function testListAnnotationGermanKeys()
+ {
+ $this->assertEquals(
+ array('INBOX/Kalender', 'INBOX/Kontakte', 'INBOX/Notizen', 'INBOX/Aufgaben'),
+ array_keys(
+ $this->getGermanAnnotatedMock()->listAnnotation(
+ '/shared/vendor/kolab/folder-type'
+ )
+ )
+ );
+ }
+
public function testGetAnnotationReturnsAnnotationValue()
{
$this->markTestIncomplete();
$list->listFolders()
);
}
+
+ public function testTypeReturnsArray()
+ {
+ $list = new Horde_Kolab_Storage_List_Base($this->getNullMock());
+ $this->assertType('array', $list->listTypes());
+ }
+
+ public function testTypeReturnsAnnotations()
+ {
+ $list = new Horde_Kolab_Storage_List_Base($this->getAnnotatedMock());
+ $this->assertEquals(
+ array(
+ 'INBOX/Calendar' => 'event.default',
+ 'INBOX/Contacts' => 'contact.default',
+ 'INBOX/Notes' => 'note.default',
+ 'INBOX/Tasks' => 'task.default',
+ ),
+ $list->listTypes()
+ );
+ }
+
}
class Horde_Kolab_Storage_Unit_List_Decorator_LogTest
extends Horde_Kolab_Storage_TestCase
{
- public function testListLogsEntry()
+ public function testListFolderCount()
{
$list = new Horde_Kolab_Storage_List_Decorator_Log(
new Horde_Kolab_Storage_List_Base($this->getNullMock()),
$this->assertLogCount(2);
}
- public function testListFolderCount()
+ public function testListLogsEntry()
{
$list = new Horde_Kolab_Storage_List_Decorator_Log(
new Horde_Kolab_Storage_List_Base($this->getTwoFolderMock()),
$list->listFolders();
$this->assertLogContains('List contained 2 folders.');
}
+
+ public function testListTypesFolderCount()
+ {
+ $list = new Horde_Kolab_Storage_List_Decorator_Log(
+ new Horde_Kolab_Storage_List_Base($this->getNullMock()),
+ $this->getMockLogger()
+ );
+ $list->listTypes();
+ $this->assertLogCount(2);
+ }
+
+ public function testListTypesLogsEntry()
+ {
+ $list = new Horde_Kolab_Storage_List_Decorator_Log(
+ new Horde_Kolab_Storage_List_Base($this->getAnnotatedMock()),
+ $this->getMockLogger()
+ );
+ $list->listtypes();
+ $this->assertLogContains('List contained 4 folders and types.');
+ }
}