1<?php
2/**
3 * Test the handler for a simple LDAP setup without read-only slaves.
4 *
5 * PHP version 5
6 *
7 * @category Kolab
8 * @package  Kolab_Server
9 * @author   Gunnar Wrobel <wrobel@pardus.de>
10 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
11 * @link     http://pear.horde.org/index.php?package=Kolab_Server
12 */
13
14/**
15 * Require our basic test case definition
16 */
17require_once __DIR__ . '/../../../LdapTestCase.php';
18
19/**
20 * Test the handler for a simple LDAP setup without read-only slaves.
21 *
22 * Copyright 2009-2016 Horde LLC (http://www.horde.org/)
23 *
24 * See the enclosed file COPYING for license information (LGPL). If you
25 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
26 *
27 * @category Kolab
28 * @package  Kolab_Server
29 * @author   Gunnar Wrobel <wrobel@pardus.de>
30 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
31 * @link     http://pear.horde.org/index.php?package=Kolab_Server
32 */
33class Horde_Kolab_Server_Class_Server_Connection_SimpleldapTest
34extends Horde_Kolab_Server_LdapTestCase
35{
36    public function testMethodConstructHasParameterNetldap2Connection()
37    {
38        $this->skipIfNoLdap();
39        $ldap = $this->getMock('Horde_Ldap');
40        $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
41    }
42
43    public function testMethodConstructHasPostconditionThatTheGivenServerWasStored()
44    {
45        $this->skipIfNoLdap();
46        $ldap = $this->getMock('Horde_Ldap');
47        $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
48        $this->assertSame($ldap, $conn->getRead());
49    }
50
51    public function testMethodGetreadHasResultNetldap2TheHandledConnection()
52    {
53        $this->skipIfNoLdap();
54        $ldap = $this->getMock('Horde_Ldap');
55        $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
56        $this->assertInstanceOf('Horde_Ldap', $conn->getRead());
57    }
58
59    public function testMethodGetwriteHasResultNetldap2TheHandledConnection()
60    {
61        $this->skipIfNoLdap();
62        $ldap = $this->getMock('Horde_Ldap');
63        $conn = new Horde_Kolab_Server_Connection_Simpleldap($ldap);
64        $this->assertSame($conn->getWrite(), $conn->getRead());
65    }
66}
67