Add some stub definitions for the basic Horde services so that the
authorGunnar Wrobel <p@rdus.de>
Wed, 3 Mar 2010 16:03:35 +0000 (17:03 +0100)
committerGunnar Wrobel <p@rdus.de>
Wed, 3 Mar 2010 16:03:35 +0000 (17:03 +0100)
tests also run outside of the Horde framework context. It would
probably be cleaner to stub the backend though.

framework/LoginTasks/test/Horde/LoginTasks/Stubs.php

index da18568..0d7dd4a 100644 (file)
@@ -1,5 +1,50 @@
 <?php
 
+if (!class_exists('Horde_Prefs')) {
+    class Horde_Prefs {
+        public function setValue($pref, $val, $convert = true)
+        {
+        }
+
+        public function getValue($pref, $convert = true)
+        {
+        }
+    }
+}
+
+if (!class_exists('Horde_Registry')) {
+    class Horde_Registry {
+        public function get($parameter, $app = null)
+        {
+        }
+
+        public function getAppDrivers($app, $prefix)
+        {
+        }
+    }
+}
+
+if (!class_exists('Horde')) {
+    class Horde {
+        static public function url($url)
+        {
+            $url = new Horde_Url($url);
+            return 'http://' . (string) $url;
+        }
+    }
+}
+
+if (!class_exists('Horde_Auth')) {
+    class Horde_Auth {
+        static public function getAuth()
+        {
+            return empty($_SESSION['horde_auth']['userId'])
+                ? false
+                : $_SESSION['horde_auth']['userId'];
+        }
+    }
+}
+
 class Horde_LoginTasks_Stub_Prefs
 extends Horde_Prefs
 {