skip tests that don't work because $world['auth'] doesn't exist yet
authorChuck Hagenbuch <chuck@horde.org>
Sun, 4 Oct 2009 01:32:09 +0000 (21:32 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sun, 4 Oct 2009 01:32:09 +0000 (21:32 -0400)
framework/Kolab_Storage/test/Horde/Kolab/Storage/AttachmentTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/DataTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/FolderTest.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/StorageTest.php

index ffff7ae..f9e3d76 100644 (file)
@@ -38,7 +38,6 @@ require_once 'Autoload.php';
  */
 class Horde_Kolab_Storage_AttachmentTest extends Horde_Kolab_Storage_Scenario
 {
-
     /**
      * Test setup.
      *
@@ -46,6 +45,9 @@ class Horde_Kolab_Storage_AttachmentTest 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();
 
         $this->storage = $this->authenticate($world['auth'],
@@ -61,7 +63,9 @@ class Horde_Kolab_Storage_AttachmentTest extends Horde_Kolab_Storage_Scenario
     public function tearDown()
     {
         Horde_Imap_Client_Mock::clean();
-        $this->storage->clean();
+        if ($this->storage) {
+            $this->storage->clean();
+        }
     }
 
     /**
index d6739cf..c1e6892 100644 (file)
@@ -32,12 +32,14 @@ require_once 'Autoload.php';
  */
 class Horde_Kolab_Storage_DataTest extends Horde_Kolab_Storage_Scenario
 {
-
     /**
      * Test setup.
      */
     public function setUp()
     {
+        // No 'auth' in world, so this won't work yet. Skip it.
+        $this->markTestSkipped();
+
         $world = $this->prepareBasicSetup();
 
         $this->storage = $this->authenticate($world['auth'],
@@ -54,7 +56,9 @@ class Horde_Kolab_Storage_DataTest extends Horde_Kolab_Storage_Scenario
     public function tearDown()
     {
         Horde_Imap_Client_Mock::clean();
-        $this->storage->clean();
+        if ($this->storage) {
+            $this->storage->clean();
+        }
     }
 
     /**
index b27c3e8..067ad5f 100644 (file)
@@ -32,12 +32,14 @@ require_once 'Autoload.php';
  */
 class Horde_Kolab_Storage_FolderTest extends Horde_Kolab_Storage_Scenario
 {
-
     /**
      * Test setup.
      */
     public function setUp()
     {
+        // No 'auth' in world, so this won't work yet. Skip it.
+        $this->markTestSkipped();
+
         $world = $this->prepareBasicSetup();
 
         $this->storage = $this->authenticate($world['auth'],
@@ -49,6 +51,17 @@ class Horde_Kolab_Storage_FolderTest extends Horde_Kolab_Storage_Scenario
     }
 
     /**
+     * Test destruction.
+     */
+    public function tearDown()
+    {
+        Horde_Imap_Client_Mock::clean();
+        if ($this->storage) {
+            $this->storage->clean();
+        }
+    }
+
+    /**
      * Test class creation.
      */
     public function testConstruct()
@@ -61,15 +74,6 @@ class Horde_Kolab_Storage_FolderTest extends Horde_Kolab_Storage_Scenario
     }
 
     /**
-     * Test destruction.
-     */
-    public function tearDown()
-    {
-        Horde_Imap_Client_Mock::clean();
-        $this->storage->clean();
-    }
-
-    /**
      * Test renaming.
      */
     public function testSetName()
index 1763e7e..d5d88de 100644 (file)
@@ -377,11 +377,13 @@ EOD;
         return $folder;
     }
 
-    function provideServerName() {
+    function provideServerName()
+    {
         return 'localhost';
     }
 
-    function provideHordeBase() {
+    function provideHordeBase()
+    {
         return Horde::getTempDir() . '/test_config';
     }
 
@@ -397,3 +399,28 @@ EOD;
         return $this->prepareEmptyKolabStorage($params);
     }
 }
+
+/* Stand-in functions if gettext is not available. */
+if (!function_exists('_')) {
+    function _($string)
+    {
+        return $string;
+    }
+}
+
+if (!function_exists('ngettext')) {
+    function ngettext($msgid1, $msgid2, $n)
+    {
+        return $n > 1 ? $msgid2 : $msgid1;
+    }
+}
+
+if (!function_exists('bindtextdomain')) {
+    function bindtextdomain()
+    {}
+}
+
+if (!function_exists('textdomain')) {
+    function textdomain()
+    {}
+}
index 423f774..6b89c46 100644 (file)
@@ -41,6 +41,9 @@ 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();
 
         /** Prepare a Kolab test storage */
@@ -80,7 +83,9 @@ class Horde_Kolab_Storage_StorageTest extends Horde_Kolab_Storage_Scenario
     public function tearDown()
     {
         Horde_Imap_Client_Mock::clean();
-        $this->storage->clean();
+        if ($this->storage) {
+            $this->storage->clean();
+        }
     }
 
     /**