Test the area we are about to modify.
authorGunnar Wrobel <p@rdus.de>
Thu, 11 Mar 2010 19:49:27 +0000 (20:49 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Thu, 11 Mar 2010 21:35:04 +0000 (22:35 +0100)
framework/Kolab_Storage/test/Horde/Kolab/Storage/StorageTest.php

index 4b7d5ef..6f7932a 100644 (file)
@@ -41,38 +41,35 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function setUp()
     {
-        // No 'auth' in world, so this won't work yet. Skip it.
-        $this->markTestSkipped();
+        /* $world = $this->prepareBasicSetup(); */
 
-        $world = $this->prepareBasicSetup();
+        /* /\** Prepare a Kolab test storage *\/ */
+        /* $params   = array('driver'   => 'Mock', */
+        /*                   'username' => 'wrobel@example.org', */
+        /*                   'password' => 'none'); */
+        /* $storage1 = Horde_Kolab_Storage::singleton('imap', $params); */
 
-        /** Prepare a Kolab test storage */
-        $params   = array('driver'   => 'Mock',
-                          'username' => 'wrobel@example.org',
-                          'password' => 'none');
-        $storage1 = Horde_Kolab_Storage::singleton('imap', $params);
+        /* $folder = $this->prepareNewFolder($storage1, 'Contacts', 'contact', true); */
+        /* $perms  = $folder->getPermission(); */
+        /* $perms->addUserPermission('test@example.org', Horde_Perms::SHOW); */
+        /* $perms->save(); */
 
-        $folder = $this->prepareNewFolder($storage1, 'Contacts', 'contact', true);
-        $perms  = $folder->getPermission();
-        $perms->addUserPermission('test@example.org', Horde_Perms::SHOW);
-        $perms->save();
+        /* $folder = $this->prepareNewFolder($storage1, 'Calendar', 'event', true); */
+        /* $perms  = $folder->getPermission(); */
+        /* $perms->addUserPermission('test@example.org', Horde_Perms::SHOW); */
+        /* $perms->save(); */
 
-        $folder = $this->prepareNewFolder($storage1, 'Calendar', 'event', true);
-        $perms  = $folder->getPermission();
-        $perms->addUserPermission('test@example.org', Horde_Perms::SHOW);
-        $perms->save();
+        /* /\** Prepare a Kolab test storage *\/ */
+        /* $storage2 = $this->authenticate($world['auth'], */
+        /*                                 'test@example.org', */
+        /*                                 'test'); */
 
-        /** Prepare a Kolab test storage */
-        $storage2 = $this->authenticate($world['auth'],
-                                        'test@example.org',
-                                        'test');
+        /* $this->prepareNewFolder($storage2, 'Contacts', 'contact', true); */
+        /* $this->prepareNewFolder($storage2, 'TestContacts', 'contact'); */
+        /* $this->prepareNewFolder($storage2, 'Calendar', 'event', true); */
+        /* $this->prepareNewFolder($storage2, 'TestCalendar', 'event'); */
 
-        $this->prepareNewFolder($storage2, 'Contacts', 'contact', true);
-        $this->prepareNewFolder($storage2, 'TestContacts', 'contact');
-        $this->prepareNewFolder($storage2, 'Calendar', 'event', true);
-        $this->prepareNewFolder($storage2, 'TestCalendar', 'event');
-
-        $this->storage = &$storage2;
+        /* $this->storage = &$storage2; */
     }
 
     /**
@@ -82,10 +79,10 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function tearDown()
     {
-        Horde_Imap_Client_Mock::clean();
-        if ($this->storage) {
-            $this->storage->clean();
-        }
+        /* Horde_Imap_Client_Mock::clean(); */
+        /* if ($this->storage) { */
+        /*     $this->storage->clean(); */
+        /* } */
     }
 
     /**
@@ -95,6 +92,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testConstruct()
     {
+        $this->markTestSkipped();
+
         $this->assertTrue($this->storage instanceOf Horde_Kolab_Storage);
     }
 
@@ -105,6 +104,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testListFolders()
     {
+        $this->markTestSkipped();
+
         $folders = $this->storage->listFolders();
         $this->assertContains('INBOX/Contacts', $folders);
     }
@@ -116,7 +117,16 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetFolders()
     {
-        $folders = $this->storage->getFolders();
+        $this->markTestSkipped();
+
+        $storage = new Horde_Kolab_Storage(
+            'Imap',
+            array(
+                'username' => 'test',
+                'password' => 'test',
+            )  
+        );
+        $folders = $storage->getFolders();
         $this->assertEquals(6, count($folders));
         $folder_names = array();
         foreach ($folders as $folder) {
@@ -125,6 +135,19 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
         $this->assertContains('INBOX/Contacts', $folder_names);
     }
 
+    public function testGetFolder()
+    {
+        $storage = new Horde_Kolab_Storage(
+            'Imap',
+            array(
+                'username' => 'test',
+                'password' => 'test',
+            )  
+        );
+        $folder = $storage->getFolder('INBOX');
+        $this->assertEquals('INBOX', $folder->name);
+    }
+
     /**
      * Test retrieving by share ID.
      *
@@ -132,6 +155,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetByShare()
     {
+        $this->markTestSkipped();
+
         $folder = $this->storage->getByShare('test@example.org', 'event');
         $this->assertEquals('INBOX/Calendar', $folder->name);
     }
@@ -143,6 +168,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetByType()
     {
+        $this->markTestSkipped();
+
         $folders = $this->storage->getByType('event');
         $this->assertEquals(3, count($folders));
         $names = array();
@@ -160,6 +187,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetDefault()
     {
+        $this->markTestSkipped();
+
         $folder = $this->storage->getDefault('event');
         $this->assertEquals('INBOX/Calendar', $folder->name);
         $folder = $this->storage->getDefault('contact');
@@ -173,6 +202,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetForeignOwner()
     {
+        $this->markTestSkipped();
+
         $folder = $this->storage->getFolder('user/wrobel');
         $this->assertEquals('wrobel@example.org', $folder->getOwner());
     }
@@ -184,6 +215,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testGetForeignDefault()
     {
+        $this->markTestSkipped();
+
         $folder = $this->storage->getForeignDefault('wrobel@example.org', 'event');
         $this->assertEquals('user/wrobel/Calendar', $folder->name);
         $this->assertEquals('user%2Fwrobel%2FCalendar', $folder->getShareId());
@@ -199,6 +232,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testCreate()
     {
+        $this->markTestSkipped();
+
         $folder = $this->storage->getNewFolder();
         $folder->setName('Notes');
         $folder->save(array());
@@ -213,6 +248,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testCacheAdd()
     {
+        $this->markTestSkipped();
+
         $params   = array('driver'   => 'Mock',
                           'username' => 'cacheadd@example.org',
                           'password' => 'none');
@@ -234,6 +271,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testCacheDelete()
     {
+        $this->markTestSkipped();
+
         $params   = array('driver'   => 'Mock',
                           'username' => 'cachedel@example.org',
                           'password' => 'none');
@@ -257,6 +296,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testRename()
     {
+        $this->markTestSkipped();
+
         $folder = &$this->storage->getFolder('INBOX/TestContacts');
         $folder->setName('TestNotes');
         $folder->save(array());
@@ -272,6 +313,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testRemove()
     {
+        $this->markTestSkipped();
+
         $folder = &$this->storage->getFolder('INBOX/Calendar');
         $this->assertTrue($folder->exists());
         $this->assertTrue($folder->isDefault());
@@ -286,6 +329,8 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
      */
     public function testCaching()
     {
+        $this->markTestSkipped();
+
         $params   = array('driver'   => 'Mock',
                           'username' => 'cache@example.org',
                           'password' => 'none');