3 * Test the configuration based connection factory.
8 * @package Kolab_Server
9 * @author Gunnar Wrobel <wrobel@pardus.de>
10 * @license http://www.fsf.org/copyleft/lgpl.html LGPL
11 * @link http://pear.horde.org/index.php?package=Kolab_Server
15 * Require our basic test case definition
17 require_once dirname(__FILE__) . '/../../../../LdapTestCase.php';
20 * Test the configuration based connection factory.
22 * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
24 * See the enclosed file COPYING for license information (LGPL). If you
25 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
28 * @package Kolab_Server
29 * @author Gunnar Wrobel <wrobel@pardus.de>
30 * @license http://www.fsf.org/copyleft/lgpl.html LGPL
31 * @link http://pear.horde.org/index.php?package=Kolab_Server
33 class Horde_Kolab_Server_Class_Server_Factory_Connection_ConfigurationTest
34 extends Horde_Kolab_Server_LdapTestCase
36 public function testMethodConstructHasParameterArrayConfiguration()
38 $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
39 array('basedn' => 'a')
43 public function testMethodConstructHasPostconditionThatTheConfigurationWasSaved()
45 $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
46 array('basedn' => 'a')
48 $this->assertEquals(array('basedn' => 'a'), $factory->getConfiguration());
51 public function testMethodConstructHasResultArrayTheConfiguration()
53 $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
54 array('basedn' => 'a')
56 $this->assertType('array', $factory->getConfiguration());
59 public function testMethodConstructHasPostconditionThatTheConnectionFactoryHasBeenSet()
61 $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
64 $this->assertType('Horde_Kolab_Server_Connection_Mock', $factory->getConnection());
67 public function testMethodGetconnectionHasResultMockConnectionIfConfiguredThatWay()
69 $this->testMethodConstructHasPostconditionThatTheConnectionFactoryHasBeenSet();
72 public function testMethodGetconnectionHasResultLdapConnectionIfConfiguredThatWay()
74 $this->skipIfNoLdap();
75 $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
76 array('basedn' => 'a')
78 $this->assertType('Horde_Kolab_Server_Connection_Simpleldap', $factory->getConnection());