From: Gunnar Wrobel Date: Mon, 27 Dec 2010 21:13:01 +0000 (+0100) Subject: Add mocks. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0b1ee61d531d7dba8d5ff33c6da80d85fe898e8a;p=horde.git Add mocks. --- diff --git a/framework/Kolab_Storage/test/Horde/Kolab/Storage/TestCase.php b/framework/Kolab_Storage/test/Horde/Kolab/Storage/TestCase.php index e60601a8c..08e0c7490 100644 --- a/framework/Kolab_Storage/test/Horde/Kolab/Storage/TestCase.php +++ b/framework/Kolab_Storage/test/Horde/Kolab/Storage/TestCase.php @@ -72,6 +72,84 @@ extends PHPUnit_Framework_TestCase ); } + protected function getAnnotatedMock() + { + return new Horde_Kolab_Storage_Driver_Mock( + new Horde_Kolab_Storage_Factory(), + $this->getAnnotatedAccount() + ); + } + + protected function getAnnotatedAccount() + { + return array( + 'username' => 'test@example.com', + 'data' => array( + 'user/test' => null, + 'user/test/a' => null, + 'user/test/Calendar' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'event.default', + ) + ), + 'user/test/Contacts' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'contact.default', + ) + ), + 'user/test/Notes' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'note.default', + ) + ), + 'user/test/Tasks' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'task.default', + ) + ), + ) + ); + } + + protected function getGermanAnnotatedMock() + { + return new Horde_Kolab_Storage_Driver_Mock( + new Horde_Kolab_Storage_Factory(), + $this->getGermanAnnotatedAccount() + ); + } + + protected function getGermanAnnotatedAccount() + { + return array( + 'username' => 'test@example.com', + 'data' => array( + 'user/test' => null, + 'user/test/Test' => null, + 'user/test/Kalender' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'event.default', + ) + ), + 'user/test/Kontakte' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'contact.default', + ) + ), + 'user/test/Notizen' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'note.default', + ) + ), + 'user/test/Aufgaben' => array( + 'annotations' => array( + '/shared/vendor/kolab/folder-type' => 'task.default', + ) + ), + ) + ); + } + protected function getMockLogger() { $this->logHandler = new Horde_Log_Handler_Mock();