1<?php
2/**
3 * Test the handler for a mock connection.
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 * Test the handler for a mock connection.
16 *
17 * Copyright 2009-2016 Horde LLC (http://www.horde.org/)
18 *
19 * See the enclosed file COPYING for license information (LGPL). If you
20 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21 *
22 * @category Kolab
23 * @package  Kolab_Server
24 * @author   Gunnar Wrobel <wrobel@pardus.de>
25 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
26 * @link     http://pear.horde.org/index.php?package=Kolab_Server
27 */
28class Horde_Kolab_Server_Class_Server_Connection_MockTest
29extends PHPUnit_Framework_TestCase
30{
31    public function testMethodConstructHasParameterMockldapConnection()
32    {
33        $ldap = $this->getMock(
34            'Horde_Kolab_Server_Connection_Mock_Ldap',
35            array(), array(), '', false, false
36        );
37        $conn = new Horde_Kolab_Server_Connection_Mock($ldap);
38    }
39
40    public function testMethodConstructHasPostconditionThatTheGivenServerWasStored()
41    {
42        $ldap = $this->getMock(
43            'Horde_Kolab_Server_Connection_Mock_Ldap',
44            array(), array(), '', false, false
45        );
46        $conn = new Horde_Kolab_Server_Connection_Mock($ldap);
47        $this->assertSame($ldap, $conn->getRead());
48    }
49
50    public function testMethodGetreadHasResultMockldapTheHandledConnection()
51    {
52        $ldap = $this->getMock(
53            'Horde_Kolab_Server_Connection_Mock_Ldap',
54            array(), array(), '', false, false
55        );
56        $conn = new Horde_Kolab_Server_Connection_Mock($ldap);
57        $this->assertInstanceOf('Horde_Kolab_Server_Connection_Mock_Ldap', $conn->getRead());
58    }
59
60    public function testMethodGetwriteHasResultMockldapTheHandledConnection()
61    {
62        $ldap = $this->getMock(
63            'Horde_Kolab_Server_Connection_Mock_Ldap',
64            array(), array(), '', false, false
65        );
66        $conn = new Horde_Kolab_Server_Connection_Mock($ldap);
67        $this->assertSame($conn->getWrite(), $conn->getRead());
68    }
69}
70