summaryrefslogtreecommitdiff
path: root/test/KolabAdmin/Unit/BaseTest.php
blob: 9ee2d41087a61b28a614c289bb408672a91d5be7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
 * Test the webadmin code.
 *
 * PHP version 5
 *
 * @category Kolab
 * @package  KolabAdmin
 * @author   Gunnar Wrobel <wrobel@pardus.de>
 * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
 * @link     http://pear.horde.org/index.php?package=KolabAdmin
 */

/**
 * Require the tested classes.
 */
require_once dirname(__FILE__) . '/../../../lib/KolabAdmin/Ldap.php';

/**
 * Test the webadmin code.
 *
 * Copyright 2010 Klarälvdalens Datakonsult AB
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @category Kolab
 * @package  KolabAdmin
 * @author   Gunnar Wrobel <wrobel@pardus.de>
 * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
 * @link     http://pear.horde.org/index.php?package=KolabAdmin
 */
class KolabAdmin_Unit_BaseTest extends PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $_SESSION = array();
        require '/kolab/etc/kolab/session_vars.php';
    }

    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() {};