gunnar: server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit BaseTest.php, 1.2, 1.3

cvs at kolab.org cvs at kolab.org
Sun Feb 21 09:19:04 CET 2010


Author: gunnar

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit
In directory doto:/tmp/cvs-serv2997/kolab-webadmin/test/KolabAdmin/Unit

Modified Files:
	BaseTest.php 
Log Message:
A first working test. This works only with an installed server right now but this results from the current code structure that simply allows no mocking/stubbing.

Index: BaseTest.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/test/KolabAdmin/Unit/BaseTest.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- BaseTest.php	21 Feb 2010 08:06:02 -0000	1.2
+++ BaseTest.php	21 Feb 2010 08:19:02 -0000	1.3
@@ -32,7 +32,21 @@
  */
 class KolabAdmin_Unit_BaseTest extends PHPUnit_Framework_TestCase
 {
-    public function testSomething()
+    public function setUp()
     {
+        $_SESSION = array();
+        require '/kolab/etc/kolab/session_vars.php';
     }
-}
\ No newline at end of file
+
+    public function testCountmailReturnsZeroOnNonExistantMail()
+    {
+        $ldap = new KolabLdap();
+        $this->assertEquals(
+            0,
+            $ldap->countMail($_SESSION['base_dn'], 'certainly at does@not at exist')
+        );
+    }
+}
+
+/** short circuit the debug function. */
+function debug() {};
\ No newline at end of file





More information about the commits mailing list