summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-02-21 08:19:02 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-02-21 08:19:02 (GMT)
commitd7ab73f4a9a5afc41d985798c5fff3828f2c2cda (patch)
tree9bf8b3752b625da6e8f4b209b1d7d7d39c3c408a
parent2b56ccf826c5e352b47cea2bf190c3852a2caa8f (diff)
downloadkolab-webadmin-d7ab73f4a9a5afc41d985798c5fff3828f2c2cda.tar.gz
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.
-rw-r--r--test/KolabAdmin/Unit/BaseTest.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/KolabAdmin/Unit/BaseTest.php b/test/KolabAdmin/Unit/BaseTest.php
index 4b36d55..9ee2d41 100644
--- a/test/KolabAdmin/Unit/BaseTest.php
+++ b/test/KolabAdmin/Unit/BaseTest.php
@@ -32,7 +32,21 @@ require_once dirname(__FILE__) . '/../../../lib/KolabAdmin/Ldap.php';
*/
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@does@not@exist')
+ );
+ }
+}
+
+/** short circuit the debug function. */
+function debug() {}; \ No newline at end of file