Don't run these tests if the NLS system cannot be initialized
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 12 Apr 2010 18:55:15 +0000 (14:55 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 12 Apr 2010 19:17:33 +0000 (15:17 -0400)
framework/ActiveSync/test/Horde/ActiveSync/HordeDriverTest.php

index acd7d64..93ec482 100644 (file)
@@ -129,10 +129,17 @@ class Horde_ActiveSync_HordeDriverTest extends Horde_Test_Case
             'smimePublicKey' => '',
         );
 
-        // Need to init the Nls system
         if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
             error_reporting(E_ALL & ~E_DEPRECATED);
         }
+
+        /* This test REQUIRES that the NLS system be initialized, so skip this
+         * if we don't have a configured horde
+         */
+        if (!file_exists(dirname(__FILE__) . '/../../../../../horde/config/conf.php')) {
+            $this->markTestIncomplete('Test requires the NLS system');
+            return;
+        }
         require_once dirname(__FILE__) . '/../../../../../horde/lib/core.php';
         Horde_Nls::setLanguage();
         
@@ -171,10 +178,17 @@ class Horde_ActiveSync_HordeDriverTest extends Horde_Test_Case
      */
     public function testStreamerUTF8()
     {
-        // Need to init the Nls system
         if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
             error_reporting(E_ALL & ~E_DEPRECATED);
         }
+
+        /* This test REQUIRES that the NLS system be initialized, so skip this
+         * if we don't have a configured horde
+         */
+        if (!file_exists(dirname(__FILE__) . '/../../../../../horde/config/conf.php')) {
+            $this->markTestIncomplete('Test requires the NLS system');
+            return;
+        }
         require_once dirname(__FILE__) . '/../../../../../horde/lib/core.php';
         Horde_Nls::setLanguage();
         
@@ -224,10 +238,18 @@ class Horde_ActiveSync_HordeDriverTest extends Horde_Test_Case
         $message->homestate = 'NJ';
         $message->homepostalcode = '08080';
 
-        // Need to init the Nls system
+
         if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
             error_reporting(E_ALL & ~E_DEPRECATED);
         }
+
+        /* This test REQUIRES that the NLS system be initialized, so skip this
+         * if we don't have a configured horde
+         */
+        if (!file_exists(dirname(__FILE__) . '/../../../../../horde/config/conf.php')) {
+            $this->markTestIncomplete('Test requires the NLS system');
+            return;
+        }
         require_once dirname(__FILE__) . '/../../../../../horde/lib/core.php';
         Horde_Nls::setLanguage();