Condense the factory experiments from Horde_Kolab_Server into a single factory in...
authorGunnar Wrobel <p@rdus.de>
Tue, 16 Mar 2010 19:30:30 +0000 (20:30 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Tue, 16 Mar 2010 19:31:02 +0000 (20:31 +0100)
39 files changed:
framework/Core/lib/Horde/Core/Factory/KolabServer.php [new file with mode: 0644]
framework/Core/lib/Horde/Registry.php
framework/Core/package.xml
framework/Core/test/Horde/Core/AllTests.php [new file with mode: 0644]
framework/Core/test/Horde/Core/Autoload.php [new file with mode: 0644]
framework/Core/test/Horde/Core/Factory/KolabServerTest.php [new file with mode: 0644]
framework/Core/test/Horde/Core/phpunit.xml [new file with mode: 0644]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Base.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Base.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Configuration.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Injector.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Interface.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Ldap.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Mock.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Constructor.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Clean.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Count.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Log.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Map.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Default.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Injector.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Interface.php [deleted file]
framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Kolab.php [deleted file]
framework/Kolab_Server/package.xml
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/ConfigurationTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/InjectorTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/LdapTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/MockTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CleanTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CountTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/LogTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/MapTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/KolabTest.php [deleted file]
framework/Kolab_Server/test/Horde/Kolab/Server/Integration/SearchguidforuidormailTest.php
framework/Share/Share/kolab.php

diff --git a/framework/Core/lib/Horde/Core/Factory/KolabServer.php b/framework/Core/lib/Horde/Core/Factory/KolabServer.php
new file mode 100644 (file)
index 0000000..9115737
--- /dev/null
@@ -0,0 +1,358 @@
+<?php
+/**
+ * A factory for Kolab server objects.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+
+/**
+ * A factory for Kolab server objects.
+ *
+ * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
+ *
+ * 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 Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+class Horde_Core_Factory_KolabServer
+{
+    /**
+     * The injector.
+     *
+     * @var Horde_Injector
+     */
+    private $_injector;
+
+    /**
+     * Constructor.
+     *
+     * @param Horde_Injector $injector The injector to use.
+     */
+    public function __construct(
+        Horde_Injector $injector
+    ) {
+        $this->_injector = $injector;
+        $this->_setup();
+    }
+
+    /**
+     * Setup the machinery to create Horde_Kolab_Server objects.
+     *
+     * @return NULL
+     */
+    private function _setup()
+    {
+        $this->_setupConfiguration();
+        $this->_setupConnection();
+        $this->_setupObjects();
+        $this->_setupSearch();
+        $this->_setupSchema();
+        $this->_setupStructure();
+        $this->_setupServer();
+    }
+
+    /**
+     * Inject the server configuration.
+     *
+     * @return NULL
+     */
+    private function _setupConfiguration()
+    {
+        $configuration = array();
+
+        //@todo: Update configuration parameters
+        if (!empty($GLOBALS['conf']['kolab']['ldap'])) {
+            $configuration = $GLOBALS['conf']['kolab']['ldap'];
+        }
+        if (!empty($GLOBALS['conf']['kolab']['server'])) {
+            $configuration = $GLOBALS['conf']['kolab']['server'];
+        }
+
+        if (isset($configuration['server'])) {
+            $configuration['host'] = $configuration['server'];
+            unset($configuration['server']);
+        }
+
+        if (isset($configuration['phpdn'])) {
+            $configuration['binddn'] = $configuration['phpdn'];
+            unset($configuration['phpdn']);
+        }
+
+        if (isset($configuration['phppw'])) {
+            $configuration['bindpw'] = $configuration['phppw'];
+            unset($configuration['phppw']);
+        }
+
+        $this->_injector->setInstance(
+            'Horde_Kolab_Server_Configuration', $configuration
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server_Connection.
+     *
+     * @return NULL
+     */
+    private function _setupConnection()
+    {
+        $this->_injector->bindFactory(
+            'Horde_Kolab_Server_Connection',
+            'Horde_Core_Factory_KolabServer',
+            'getConnection'
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server_Objects handler.
+     *
+     * @return NULL
+     */
+    private function _setupObjects()
+    {
+        $this->_injector->bindImplementation(
+            'Horde_Kolab_Server_Objects_Interface',
+            'Horde_Kolab_Server_Objects_Base'
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server_Search handler.
+     *
+     * @return NULL
+     */
+    private function _setupSearch()
+    {
+        $this->_injector->bindImplementation(
+            'Horde_Kolab_Server_Search_Interface',
+            'Horde_Kolab_Server_Search_Base'
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server_Schema handler.
+     *
+     * @return NULL
+     */
+    private function _setupSchema()
+    {
+        $this->_injector->bindImplementation(
+            'Horde_Kolab_Server_Schema_Interface',
+            'Horde_Kolab_Server_Schema_Base'
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server_Structure handler.
+     *
+     * @return NULL
+     */
+    private function _setupStructure()
+    {
+        $configuration = $this->getConfiguration();
+        if (!isset($configuration['structure']['driver'])) {
+            $driver = 'Horde_Kolab_Server_Structure_Kolab';
+        } else {
+            $driver = $configuration['structure']['driver'];
+        }
+
+        $this->_injector->bindImplementation(
+            'Horde_Kolab_Server_Structure_Interface', $driver
+        );
+    }
+
+    /**
+     * Setup the machinery to create a Horde_Kolab_Server.
+     *
+     * @return NULL
+     */
+    private function _setupServer()
+    {
+        $this->_injector->bindFactory(
+            'Horde_Kolab_Server_Interface',
+            'Horde_Core_Factory_KolabServer',
+            'getServer'
+        );
+    }
+
+    /**
+     * Return the conn server connection that should be used.
+     *
+     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
+     */
+    public function getConnection()
+    {
+        $configuration = $this->_injector->getInstance('Horde_Kolab_Server_Configuration');
+        if (empty($configuration['mock'])) {
+            if (!isset($configuration['basedn'])) {
+                throw new Horde_Exception('The parameter \'basedn\' is missing in the Kolab server configuration!');
+            }
+
+            $ldap_read = new Horde_Ldap($configuration);
+            if (isset($configuration['host_master'])) {
+                $configuration['host'] = $configuration['host_master'];
+                $ldap_write = new Horde_Ldap($configuration);
+                $connection = new Horde_Kolab_Server_Connection_Splittedldap(
+                    $ldap_read, $ldap_write
+                );
+            } else {
+                $connection = new Horde_Kolab_Server_Connection_Simpleldap(
+                    $ldap_read
+                );
+            }
+            return $connection;
+        } else {
+            if (isset($configuration['data'])) {
+                $data = $configuration['data'];
+            } else {
+                $data = array();
+            }
+            $connection = new Horde_Kolab_Server_Connection_Mock(
+                new Horde_Kolab_Server_Connection_Mock_Ldap(
+                    $configuration, $data
+                )
+            );
+            return $connection;
+        }
+    }
+
+    /**
+     * Returns the server configuration parameters.
+     *
+     * @return array The configuration parameters.
+     */
+    public function getConfiguration()
+    {
+        return $this->_injector->getInstance('Horde_Kolab_Server_Configuration');
+    }
+
+    /**
+     * Return the server connection that should be used.
+     *
+     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
+     */
+    public function getServer()
+    {
+        $configuration = $this->getConfiguration();
+        if (!isset($configuration['basedn'])) {
+            throw new Horde_Exception('The parameter \'basedn\' is missing in the Kolab server configuration!');
+        }
+
+        $connection = $this->getConnection();
+
+        if (!isset($configuration['filter'])) {
+            $server = new Horde_Kolab_Server_Ldap_Standard(
+                $connection,
+                $configuration['basedn']
+            );
+        } else {
+            $server = new Horde_Kolab_Server_Ldap_Filtered(
+                $connection,
+                $configuration['basedn'],
+                $configuration['filter']
+            );
+        }
+
+        if (isset($configuration['map'])) {
+            $server = new Horde_Kolab_Server_Decorator_Map(
+                $server, $configuration['map']
+            );
+        }
+
+        if (isset($configuration['debug']) || isset($configuration['log'])) {
+            $server = new Horde_Kolab_Server_Decorator_Log(
+                $server, $this->_injector->getInstance('Horde_Log_Logger')
+            );
+        }
+
+        if (isset($configuration['debug']) || isset($configuration['count'])) {
+            $server = new Horde_Kolab_Server_Decorator_Count(
+                $server, $this->_injector->getInstance('Horde_Log_Logger')
+            );
+        }
+
+        if (!empty($configuration['cleanup'])) {
+            $server = new Horde_Kolab_Server_Decorator_Clean(
+                $server
+            );
+        }
+        return $server;
+    }
+
+    /**
+     * Return the object handler that should be used.
+     *
+     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
+     */
+    public function getObjects()
+    {
+        return $this->_injector->getInstance(
+            'Horde_Kolab_Server_Objects_Interface'
+        );
+    }
+
+    /**
+     * Return the structural representation that should be used.
+     *
+     * @return Horde_Kolab_Server_Structure The representation of the db
+     *                                      structure.
+     */
+    public function getStructure()
+    {
+        return $this->_injector->getInstance(
+            'Horde_Kolab_Server_Structure_Interface'
+        );
+    }
+
+    /**
+     * Return the search handler that should be used.
+     *
+     * @return Horde_Kolab_Server_Search The search handler.
+     */
+    public function getSearch()
+    {
+        return $this->_injector->getInstance(
+            'Horde_Kolab_Server_Search_Interface'
+        );
+    }
+
+    /**
+     * Return the db schema representation that should be used.
+     *
+     * @return Horde_Kolab_Server_Schema The db schema representation.
+     */
+    public function getSchema()
+    {
+        return $this->_injector->getInstance(
+            'Horde_Kolab_Server_Schema_Interface'
+        );
+    }
+
+    /**
+     * Returns a concrete Horde_Kolab_Server_Composite instance.
+     *
+     * @return Horde_Kolab_Server_Composite The newly created concrete
+     *                                      Horde_Kolab_Server_Composite
+     *                                      instance.
+     */
+    public function getComposite()
+    {
+        return new Horde_Kolab_Server_Composite(
+            $this->getServer(),
+            $this->getObjects(),
+            $this->getStructure(),
+            $this->getSearch(),
+            $this->getSchema()
+        );
+    }
+}
\ No newline at end of file
index 6642d50..602a190 100644 (file)
@@ -238,6 +238,7 @@ class Horde_Registry
         $injector->addBinder('Horde_Perms', new Horde_Core_Binder_Perms());
         $injector->addBinder('Horde_Template', new Horde_Core_Binder_Template());
         $injector->addBinder('Net_DNS_Resolver', new Horde_Core_Binder_Dns());
+        $injector->bindFactory('Horde_Kolab_Server_Composite', 'Horde_Core_Factory_KolabServer', 'getComposite');
 
         $GLOBALS['registry'] = $this;
         $injector->setInstance('Horde_Registry', $this);
index 1fbdb19..23b2a1d 100644 (file)
@@ -72,6 +72,9 @@ Application Framework.
        <file name="Perms.php" role="php" />
        <file name="Template.php" role="php" />
       </dir> <!-- /lib/Horde/Core/Binder -->
+      <dir name="Factory">
+       <file name="KolabServer.php" role="php" />
+      </dir> <!-- /lib/Horde/Core/Factory -->
       <dir name="Notification">
        <file name="Status.php" role="php" />
       </dir> <!-- /lib/Horde/Core/Notification -->
@@ -103,6 +106,12 @@ Application Framework.
    <dir name="test">
     <dir name="Horde">
      <dir name="Core">
+      <file name="AllTests.php" role="test" />
+      <file name="Autoload.php" role="test" />
+      <dir name="Factory">
+       <file name="KolabServerTest.php" role="test" />
+      </dir> <!-- /test/Horde/Core/Factory -->
+      <file name="phpunit.xml" role="test" />
       <file name="url.phpt" role="test" />
      </dir> <!-- /test/Horde/Core -->
     </dir> <!-- /test/Horde -->
@@ -175,6 +184,7 @@ Application Framework.
    <install name="lib/Horde/Core/Binder/Notification.php" as="Horde/Core/Binder/Notification.php" />
    <install name="lib/Horde/Core/Binder/Perms.php" as="Horde/Core/Binder/Perms.php" />
    <install name="lib/Horde/Core/Binder/Template.php" as="Horde/Core/Binder/Template.php" />
+   <install name="lib/Horde/Core/Factory/KolabServer.php" as="Horde/Core/Factory/KolabServer.php" />
    <install name="lib/Horde/Core/Notification/Status.php" as="Horde/Core/Notification/Status.php" />
    <install name="lib/Horde/ErrorHandler.php" as="Horde/ErrorHandler.php" />
    <install name="lib/Horde/Exception/HookNotSet.php" as="Horde/Exception/HookNotSet.php" />
@@ -190,6 +200,9 @@ Application Framework.
    <install name="lib/Horde/Themes/Image.php" as="Horde/Themes/Image.php" />
    <install name="lib/Horde/Themes/Sound.php" as="Horde/Themes/Sound.php" />
    <install name="lib/Horde.php" as="Horde.php" />
+   <install name="test/Horde/Core/AllTests.php" as="Horde/Core/AllTests.php" />
+   <install name="test/Horde/Core/Autoload.php" as="Horde/Core/Autoload.php" />
+   <install name="test/Horde/Core/Factory/KolabServerTest.php" as="Horde/Core/Factory/KolabServerTest.php" />
   </filelist>
  </phprelease>
  <changelog>
diff --git a/framework/Core/test/Horde/Core/AllTests.php b/framework/Core/test/Horde/Core/AllTests.php
new file mode 100644 (file)
index 0000000..30a445e
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * All tests for the Horde_Core:: package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+
+/**
+ * Define the main method
+ */
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Horde_Core_AllTests::main');
+}
+
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
+
+/**
+ * @package    Horde_Core
+ * @subpackage UnitTests
+ */
+class Horde_Core_AllTests extends Horde_Test_AllTests
+{
+}
+
+Horde_Core_AllTests::init('Horde_Core', __FILE__);
+
+if (PHPUnit_MAIN_METHOD == 'Horde_Core_AllTests::main') {
+    Horde_Core_AllTests::main();
+}
diff --git a/framework/Core/test/Horde/Core/Autoload.php b/framework/Core/test/Horde/Core/Autoload.php
new file mode 100644 (file)
index 0000000..c6bef89
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Setup autoloading for the tests.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+
+if (!spl_autoload_functions()) {
+    spl_autoload_register(
+        create_function(
+            '$class', 
+            '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class);'
+            . '$err_mask = E_ALL ^ E_WARNING;'
+            . '$oldErrorReporting = error_reporting($err_mask);'
+            . 'include "$filename.php";'
+            . 'error_reporting($oldErrorReporting);'
+        )
+    );
+}
+
+/** Catch strict standards */
+error_reporting(E_ALL | E_STRICT);
diff --git a/framework/Core/test/Horde/Core/Factory/KolabServerTest.php b/framework/Core/test/Horde/Core/Factory/KolabServerTest.php
new file mode 100644 (file)
index 0000000..5a7e525
--- /dev/null
@@ -0,0 +1,317 @@
+<?php
+/**
+ * Test the Kolab_Server factory.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+
+/**
+ * Require our basic test case definition
+ */
+require_once dirname(__FILE__) . '/../Autoload.php';
+
+/**
+ * Test the Kolab_Server factory.
+ *
+ * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
+ *
+ * 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 Horde
+ * @package  Core
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+class Horde_Core_Factory_KolabServerTest extends PHPUnit_Framework_TestCase
+{
+    public function setUp()
+    {
+        $GLOBALS['conf']['kolab']['server']['basedn'] = 'test';
+        $this->factory   = $this->getMock(
+            'Horde_Core_Factory_KolabServer', array(), array(), '', false, false
+        );
+        $this->objects   = $this->getMock(
+            'Horde_Kolab_Server_Objects_Interface'
+        );
+        $this->structure = $this->getMock(
+            'Horde_Kolab_Server_Structure_Interface'
+        );
+        $this->search    = $this->getMock(
+            'Horde_Kolab_Server_Search_Interface'
+        );
+        $this->schema    = $this->getMock(
+            'Horde_Kolab_Server_Schema_Interface'
+        );
+    }
+
+    private function _getFactory(array $configuration = array())
+    {
+        return new Horde_Core_Factory_KolabServer(
+            new Horde_Injector(new Horde_Injector_TopLevel())
+        );
+    }
+
+    public function testMethodGetserverReturnsServer()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType('Horde_Kolab_Server_Interface', $factory->getServer());
+    }
+
+    public function testMethodGetconfigurationReturnsArrayConfiguration()
+    {
+        $factory = $this->_getFactory();
+        $this->assertEquals(
+            array('basedn' => 'test'), $factory->getConfiguration()
+        );
+    }
+
+    public function testMethodGetconnectionHasResultConnection()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Connection_Interface',
+            $factory->getConnection()
+        );
+    }
+
+    public function testMethodConstructHasResultMockConnectionIfConfiguredThatWay()
+    {
+        $GLOBALS['conf']['kolab']['server']['mock'] = true;
+        $factory = $this->_getFactory();
+        $this->assertType('Horde_Kolab_Server_Connection_Mock', $factory->getConnection());
+    }
+
+    public function testMethodGetconnectionHasResultMockConnectionWithDataIfConfiguredThatWay()
+    {
+        $GLOBALS['conf']['kolab']['server']['mock'] = true;
+        $GLOBALS['conf']['kolab']['server']['data'] = array();
+        $factory = $this->_getFactory();
+        $this->assertType('Horde_Kolab_Server_Connection_Mock', $factory->getConnection());
+    }
+
+    public function testMethodConstructHasResultSimpleConnectionByDefault()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType('Horde_Kolab_Server_Connection_SimpleLdap', $factory->getConnection());
+    }
+
+    public function testMethodConstructHasResultSplittedLdapIfConfiguredThatWay()
+    {
+        $GLOBALS['conf']['kolab']['server']['host_master'] = 'master';
+        $factory = $this->_getFactory();
+        $this->assertType('Horde_Kolab_Server_Connection_SplittedLdap', $factory->getConnection());
+    }
+
+    public function testMethodGetserverHasResultServerldapstandard()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Ldap_Standard',
+            $factory->getServer()
+        );
+    }
+
+    public function testMethodGetserverThrowsExceptionIfTheBaseDnIsMissingInTheConfiguration()
+    {
+        unset($GLOBALS['conf']);
+        $factory = $this->_getFactory();
+        try {
+            $factory->getServer();
+            $this->fail('No exception!');
+        } catch (Horde_Exception $e) {
+            $this->assertEquals(
+                'The parameter \'basedn\' is missing in the Kolab server configuration!',
+                $e->getMessage()
+            );
+        }
+    }
+
+    public function testMethodGetconnectionThrowsExceptionIfTheBaseDnIsMissingInTheConfiguration()
+    {
+        unset($GLOBALS['conf']);
+        $factory = $this->_getFactory();
+        try {
+            $factory->getConnection();
+            $this->fail('No exception!');
+        } catch (Horde_Exception $e) {
+            $this->assertEquals(
+                'The parameter \'basedn\' is missing in the Kolab server configuration!',
+                $e->getMessage()
+            );
+        }
+    }
+
+    public function testMethodGetserverHasResultServerldapFilteredIfAFilterWasSet()
+    {
+        $GLOBALS['conf']['kolab']['server']['filter'] = 'filter';
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Ldap_Filtered',
+            $factory->getServer()
+        );
+    }
+
+    public function testMethodGetobjectsHasResultObjects()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Objects_Interface',
+            $factory->getObjects()
+        );
+    }
+
+    public function testMethodGetstructureHasResultStructureKolab()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Structure_Kolab',
+            $factory->getStructure()
+        );
+    }
+
+    public function testMethodGetstructureHasResultStructureLdapIfConfiguredThatWay()
+    {
+        $GLOBALS['conf']['kolab']['server']['structure'] = array(
+            'driver' => 'Horde_Kolab_Server_Structure_Ldap'
+        );
+        $factory = $this->_getFactory();
+        $this->assertNotType(
+            'Horde_Kolab_Server_Structure_Kolab',
+            $factory->getStructure()
+        );
+    }
+
+    public function testMethodGetsearchHasResultSearch()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Search_Interface',
+            $factory->getSearch()
+        );
+    }
+
+    public function testMethodGetschemaHasResultSchema()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Schema_Interface',
+            $factory->getSchema()
+        );
+    }
+
+    public function testMethodGetcompositeReturnsComposite()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Composite',
+            $factory->getComposite()
+        );
+    }
+
+    public function testMethodGetserverHasResultCountedServerIfCountingWasActivatedInTheConfiguration()
+    {
+        $GLOBALS['conf']['kolab']['server']['count'] = true;
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Decorator_Count', $factory->getServer()
+        );
+    }
+
+    public function testMethodGetserverHasResultLoggedServerIfLoggingWasActivatedInTheConfiguration()
+    {
+        $GLOBALS['conf']['kolab']['server']['log'] = true;
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Decorator_Log', $factory->getServer()
+        );
+    }
+
+    public function testMethodGetserverHasResultMappedServerIfAMappedWasProvidedInTheConfiguration()
+    {
+        $GLOBALS['conf']['kolab']['server']['map'] = array();
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Decorator_Map', $factory->getServer()
+        );
+    }
+
+    public function testMethodGetserverHasResultCleanerServerIfACleanedWasProvidedInTheConfiguration()
+    {
+        $GLOBALS['conf']['kolab']['server']['cleanup'] = true;
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'Horde_Kolab_Server_Decorator_Clean', $factory->getServer()
+        );
+    }
+
+    public function testMethodGetconfigurationHasResultArray()
+    {
+        $factory = $this->_getFactory();
+        $this->assertType(
+            'array',
+            $factory->getConfiguration()
+        );
+    }
+
+    public function testMethodGetconfigurationHasResultRewrittenServerParameter()
+    {
+        $GLOBALS['conf']['kolab']['server']['server'] = 'a';
+        $factory = $this->_getFactory();
+        $this->assertEquals(
+            array(
+                'basedn' => 'test',
+                'host' => 'a'
+            ),
+            $factory->getConfiguration()
+        );
+    }
+
+    public function testMethodGetconfigurationHasResultRewrittenPhpdnParameter()
+    {
+        $GLOBALS['conf']['kolab']['server']['phpdn'] = 'a';
+        $factory = $this->_getFactory();
+        $this->assertEquals(
+            array(
+                'basedn' => 'test',
+                'binddn' => 'a'
+            ),
+            $factory->getConfiguration()
+        );
+    }
+
+    public function testMethodGetconfigurationHasResultRewrittenPhppwParameter()
+    {
+        $GLOBALS['conf']['kolab']['server']['phppw'] = 'a';
+        $factory = $this->_getFactory();
+        $this->assertEquals(
+            array(
+                'basedn' => 'test',
+                'bindpw' => 'a'
+            ),
+            $factory->getConfiguration()
+        );
+    }
+
+    public function testMethodGetconfigurationRewritesOldConfiguration()
+    {
+        unset($GLOBALS['conf']['kolab']['server']);
+        $GLOBALS['conf']['kolab']['ldap']['basedn'] = 'test';
+        $GLOBALS['conf']['kolab']['ldap']['phppw'] = 'a';
+        $factory = $this->_getFactory();
+        $this->assertEquals(
+            array(
+                'basedn' => 'test',
+                'bindpw' => 'a'
+            ),
+            $factory->getConfiguration()
+        );
+    }
+}
\ No newline at end of file
diff --git a/framework/Core/test/Horde/Core/phpunit.xml b/framework/Core/test/Horde/Core/phpunit.xml
new file mode 100644 (file)
index 0000000..502d3c9
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit>
+  <filter>
+    <whitelist>
+      <directory suffix=".php">../../../lib</directory>
+    </whitelist>
+  </filter>
+</phpunit>
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Base.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Base.php
deleted file mode 100644 (file)
index 2d3c685..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/**
- * Basic server factory functionality.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Basic server factory functionality.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-abstract class Horde_Kolab_Server_Factory_Base
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The connection factory.
-     *
-     * @param Horde_Kolab_Server_Factory_Core
-     */
-    private $_conn_factory;
-
-    /**
-     * The server configuration parameters
-     *
-     * @param array
-     */
-    private $_configuration;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory_Conn $factory The server connection
-     *                                                 factory.
-     * @param array                           $config  Configuration
-     *                                                 parameters for the
-     *                                                 server.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Connection_Interface $factory,
-        array $config
-    ) {
-        $this->_conn_factory  = $factory;
-        $this->_configuration = $config;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_conn_factory;
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_configuration;
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $configuration = $this->getConfiguration();
-        if (!isset($configuration['basedn'])) {
-            throw new Horde_Kolab_Server_Exception('The base DN is missing');
-        }
-
-        $connection = $this->getConnection();
-
-        if (!isset($configuration['filter'])) {
-            $server = new Horde_Kolab_Server_Ldap_Standard(
-                $connection,
-                $configuration['basedn']
-            );
-        } else {
-            $server = new Horde_Kolab_Server_Ldap_Filtered(
-                $connection,
-                $configuration['basedn'],
-                $configuration['filter']
-            );
-        }
-        return $server;
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        $factory = $this->getConnectionFactory();
-        $factory->setConfiguration($this->getConfiguration());
-        return $factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        $composite = new Horde_Kolab_Server_Composite(
-            $this->getServer(),
-            $this->getObjects(),
-            $this->getStructure(),
-            $this->getSearch(),
-            $this->getSchema()
-        );
-        return $composite;
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Configuration.php
deleted file mode 100644 (file)
index 3dd8a29..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/**
- * A factory that receives all required details via configuration parameters.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory that receives all required details via configuration parameters.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Configuration
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * Configuration parameters for the server.
-     *
-     * @var array
-     */
-    private $_configuration;
-
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * Constructor.
-     */
-    public function __construct(array $config)
-    {
-        $this->_configuration = $config;
-
-        $connection_factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            $config
-        );
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $connection_factory, $config
-        );
-
-        if (isset($config['logger'])) {
-            $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-                $factory, $config['logger']
-            );
-        }
-
-        if (isset($config['map'])) {
-            $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-                $factory, $config['map']
-            );
-        }
-
-        if (!empty($config['cleanup'])) {
-            $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-                $factory
-            );
-        }
-
-        $this->_factory = $factory;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_factory->getConnectionFactory();
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_factory->getConfiguration();
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        return $this->_factory->getServer();
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_factory->getComposite();
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_factory->getObjects();
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_factory->getStructure();
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_factory->getSearch();
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_factory->getSchema();
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Base.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Base.php
deleted file mode 100644 (file)
index c2b97a9..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
- * A base connection factory definition.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A base connection factory definition.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-abstract class Horde_Kolab_Server_Factory_Connection_Base
-implements Horde_Kolab_Server_Factory_Connection_Interface
-{
-    /**
-     * Connection parameters.
-     *
-     * @var array
-     */
-    private $_configuration;
-
-    /**
-     * Get the connection configuration.
-     *
-     * @return array $configuration The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        if (!isset($this->_configuration)) {
-            throw new Horde_Kolab_Server_Exception(
-                'The configuration has not been set!'
-            ); 
-        }
-        return $this->_configuration;
-    }
-
-    /**
-     * Set the connection configuration.
-     *
-     * @param array $configuration The configuration parameters.
-     *
-     * @return NULL
-     */
-    public function setConfiguration(array $configuration)
-    {
-        $this->_configuration = $configuration;
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Configuration.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Configuration.php
deleted file mode 100644 (file)
index 9dcc9d2..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
- * A factory that receives all required details via configuration parameters.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory that receives all required details via configuration parameters.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Connection_Configuration
-extends Horde_Kolab_Server_Factory_Connection_Base
-{
-    /**
-     * Configuration parameters for the connection.
-     *
-     * @var array
-     */
-    private $_configuration;
-
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * Constructor.
-     */
-    public function __construct(array $config)
-    {
-        $this->setConfiguration($config);
-    }
-
-    /**
-     * Get the connection configuration.
-     *
-     * @return array $configuration The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_configuration;
-    }
-
-    /**
-     * Set the connection configuration.
-     *
-     * @param array $configuration The configuration parameters.
-     *
-     * @return NULL
-     */
-    public function setConfiguration(array $configuration)
-    {
-        $this->_configuration = $configuration;
-
-        if (empty($configuration['mock'])) {
-            $this->_factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        } else {
-            $this->_factory = new Horde_Kolab_Server_Factory_Connection_Mock();
-        }
-
-        $this->_factory->setConfiguration($configuration);
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The server connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Injector.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Injector.php
deleted file mode 100644 (file)
index fed6780..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * A factory that generates connections using the Horde_Injector.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory that generates connections using the Horde_Injector.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Connection_Injector
-extends Horde_Kolab_Server_Factory_Connection_Base
-{
-    /**
-     * The injector providing our context.
-     *
-     * @var Horde_Injector
-     */
-    private $_injector;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Injector The injector to use.
-     */
-    public function __construct(Horde_Injector $injector)
-    {
-        $this->_injector = $injector;
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The server connection.
-     */
-    public function getConnection()
-    {
-        $factory = $this->_injector->getInstance(
-            'Horde_Kolab_Server_Factory_Connection_Interface'
-        );
-        $factory->setConfiguration(
-            $this->_injector->getInstance(
-                'Horde_Kolab_Server_Configuration'
-            )
-        );
-        $connection = $factory->getConnection();
-        return $connection;
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Interface.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Interface.php
deleted file mode 100644 (file)
index ef1039b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-/**
- * The interface of Kolab server connection factories.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * The interface of Kolab server connection factories.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-interface Horde_Kolab_Server_Factory_Connection_Interface
-{
-    /**
-     * Get the connection configuration.
-     *
-     * @return array $configuration The configuration parameters.
-     */
-    public function getConfiguration();
-
-    /**
-     * Set the connection configuration.
-     *
-     * @param array $configuration The configuration parameters.
-     *
-     * @return NULL
-     */
-    public function setConfiguration(array $configuration);
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The server connection.
-     */
-    public function getConnection();
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Ldap.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Ldap.php
deleted file mode 100644 (file)
index 3a241f3..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * A factory that generates LDAP connections.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory that generates LDAP connections.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Connection_Ldap
-extends Horde_Kolab_Server_Factory_Connection_Base
-{
-    /**
-     * Set the connection configuration.
-     *
-     * @param array $configuration The configuration parameters.
-     *
-     * @return NULL
-     */
-    public function setConfiguration(array $configuration)
-    {
-        if (!isset($configuration['basedn'])) {
-            throw new Horde_Kolab_Server_Exception('The base DN is missing!');
-        }
-
-        if (isset($configuration['server'])) {
-            $configuration['host'] = $configuration['server'];
-            unset($configuration['server']);
-        }
-
-        if (isset($configuration['phpdn'])) {
-            $configuration['binddn'] = $configuration['phpdn'];
-            unset($configuration['phpdn']);
-        }
-
-        if (isset($configuration['phppw'])) {
-            $configuration['bindpw'] = $configuration['phppw'];
-            unset($configuration['phppw']);
-        }
-
-        parent::setConfiguration($configuration);
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The server connection.
-     */
-    public function getConnection()
-    {
-        $configuration = $this->getConfiguration();
-        $ldap_read = new Horde_Ldap($configuration);
-        if (isset($configuration['host_master'])) {
-            $configuration['host'] = $configuration['host_master'];
-            $ldap_write = new Horde_Ldap($configuration);
-            $connection = new Horde_Kolab_Server_Connection_Splittedldap(
-                $ldap_read, $ldap_write
-            );
-        } else {
-            $connection = new Horde_Kolab_Server_Connection_Simpleldap(
-                $ldap_read
-            );
-        }
-        return $connection;
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Mock.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Connection/Mock.php
deleted file mode 100644 (file)
index 2fe0e3e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * A factory that generates mock connections.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory that generates mock connections.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Connection_Mock
-extends Horde_Kolab_Server_Factory_Connection_Base
-{
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The server connection.
-     */
-    public function getConnection()
-    {
-        $config = $this->getConfiguration();
-        if (isset($config['data'])) {
-            $data = $config['data'];
-        } else {
-            $data = array();
-        }
-        $connection = new Horde_Kolab_Server_Connection_Mock(
-            new Horde_Kolab_Server_Connection_Mock_Ldap(
-                $config, $data
-            )
-        );
-        return $connection;
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Constructor.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Constructor.php
deleted file mode 100644 (file)
index b2c1ae5..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/**
- * A Kolab server factory that receives all required details via the
- * factory constructor.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A Kolab server factory that receives all required details via the
- * factory constructor.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Constructor
-extends Horde_Kolab_Server_Factory_Base
-{
-    /**
-     * The implementation representing the db structur.
-     *
-     * @param Horde_Kolab_Server_Structure
-     */
-    private $_structure;
-
-    /**
-     * The search handler.
-     *
-     * @param Horde_Kolab_Server_Search
-     */
-    private $_search;
-
-    /**
-     * Handles the db schema.
-     *
-     * @param Horde_Kolab_Server_Schema
-     */
-    private $_schema;
-
-    /**
-     * The object handler.
-     *
-     * @param Horde_Kolab_Server_Objects
-     */
-    private $_objects;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory_Conn $factory   The connection
-     *                                                   factory.
-     * @param Horde_Kolab_Server_Objects      $objects   The object handler.
-     * @param Horde_Kolab_Server_Structure    $structure The implementation
-     *                                                   representing the db
-     *                                                   structure.
-     * @param Horde_Kolab_Server_Search       $search    The search handler.
-     * @param Horde_Kolab_Server_Schema       $schema    Handles the db schema.
-     * @param array                           $config    Configuration
-     *                                                   parameters for the
-     *                                                   server.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Connection_Interface $factory,
-        Horde_Kolab_Server_Objects_Interface $objects,
-        Horde_Kolab_Server_Structure_Interface $structure,
-        Horde_Kolab_Server_Search_Interface $search,
-        Horde_Kolab_Server_Schema_Interface $schema,
-        array $config
-    ) {
-        parent::__construct($factory, $config);
-
-        $this->_objects       = $objects;
-        $this->_structure     = $structure;
-        $this->_search        = $search;
-        $this->_schema        = $schema;
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_objects;
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_structure;
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_search;
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_schema;
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Clean.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Clean.php
deleted file mode 100644 (file)
index 2dd65f4..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/**
- * A factory decorator that adds cleaning to the generated instances.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory decorator that adds cleaning to the generated instances.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Decorator_Clean
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory $factory The base factory.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Interface $factory
-    ) {
-        $this->_factory = $factory;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_factory->getConnectionFactory();
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_factory->getConfiguration();
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $server = $this->_factory->getServer();
-        $server = new Horde_Kolab_Server_Decorator_Clean($server);
-        return $server;
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_factory->getComposite();
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_factory->getObjects();
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_factory->getStructure();
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_factory->getSearch();
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_factory->getSchema();
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Count.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Count.php
deleted file mode 100644 (file)
index 09a8e9a..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-/**
- * A factory decorator that adds counting to the generated instances.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory decorator that adds counting to the generated instances.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Decorator_Count
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * The logger.
-     *
-     * @var mixed
-     */
-    private $_logger;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory $factory The base factory.
-     * @param mixed                       $logger  The logger isntance.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Interface $factory,
-        $logger
-    ) {
-        $this->_factory = $factory;
-        $this->_logger  = $logger;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_factory->getConnectionFactory();
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_factory->getConfiguration();
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $server = $this->_factory->getServer();
-        $server = new Horde_Kolab_Server_Decorator_Count(
-            $server, $this->_logger
-        );
-        return $server;
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_factory->getComposite();
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_factory->getObjects();
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_factory->getStructure();
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_factory->getSearch();
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_factory->getSchema();
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Log.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Log.php
deleted file mode 100644 (file)
index 1073910..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-/**
- * A factory decorator that adds logging to the generated instances.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory decorator that adds logging to the generated instances.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Decorator_Log
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * The logger.
-     *
-     * @var mixed
-     */
-    private $_logger;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory $factory The base factory.
-     * @param mixed                       $logger  The logger isntance.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Interface $factory,
-        $logger
-    ) {
-        $this->_factory = $factory;
-        $this->_logger  = $logger;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_factory->getConnectionFactory();
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_factory->getConfiguration();
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $server = $this->_factory->getServer();
-        $server = new Horde_Kolab_Server_Decorator_Log(
-            $server, $this->_logger
-        );
-        return $server;
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_factory->getComposite();
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_factory->getObjects();
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_factory->getStructure();
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_factory->getSearch();
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_factory->getSchema();
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Map.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Decorator/Map.php
deleted file mode 100644 (file)
index 9e5241b..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-/**
- * A factory decorator that adds mapping to the generated instances.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory decorator that adds mapping to the generated instances.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Decorator_Map
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The factory used for creating the instances.
-     *
-     * @var Horde_Kolab_Server_Factory
-     */
-    private $_factory;
-
-    /**
-     * The attribute mapping.
-     *
-     * @var array
-     */
-    private $_mapping;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Kolab_Server_Factory $factory The base factory.
-     * @param array                      $mapping The attribute mapping.
-     */
-    public function __construct(
-        Horde_Kolab_Server_Factory_Interface $factory,
-        array $mapping)
-    {
-        $this->_factory = $factory;
-        $this->_mapping = $mapping;
-    }
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_factory->getConnectionFactory();
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_factory->getConfiguration();
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $server = $this->_factory->getServer();
-        $server = new Horde_Kolab_Server_Decorator_Map(
-            $server, $this->_mapping
-        );
-        return $server;
-    }
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection()
-    {
-        return $this->_factory->getConnection();
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_factory->getComposite();
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_factory->getObjects();
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_factory->getStructure();
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_factory->getSearch();
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_factory->getSchema();
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Default.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Default.php
deleted file mode 100644 (file)
index 76d0318..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
- * A Kolab server factory providing defaults where applicable.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A Kolab server factory providing defaults where applicable.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-abstract class Horde_Kolab_Server_Factory_Default
-extends Horde_Kolab_Server_Factory_Base
-{
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        $objects = new Horde_Kolab_Server_Objects_Base();
-        return $objects;
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        $search = new Horde_Kolab_Server_Search_Base();
-        return $search;
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        $schema = new Horde_Kolab_Server_Schema_Base();
-        return $schema;
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Injector.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Injector.php
deleted file mode 100644 (file)
index 55a6bff..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-<?php
-/**
- * A library for accessing the Kolab user database.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A factory for Kolab server objects.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Injector
-implements Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * The injector.
-     *
-     * @var Horde_Injector
-     */
-    private $_injector;
-
-    /**
-     * Constructor.
-     *
-     * @param Horde_Injector $injector The injector to use.
-     */
-    public function __construct(
-        Horde_Injector $injector
-    ) {
-        $this->_injector      = $injector;
-        $this->_setup();
-    }
-
-    /**
-     * Prepares the injector with basic configuration information.
-     *
-     * @param string         $factory  The class name of the conn connection
-     *                                 factory.
-     * @param array          $config   Configuration parameters for the server.
-     * @param Horde_Injector $injector The injector to use.
-     *
-     * @return NULL
-     */
-    static public function setup(
-        $factory,
-        array $config,
-        Horde_Injector $injector
-    ) {
-        self::_setupConfiguration($config, $injector);
-        self::_setupConnectionFactory($factory, $injector);
-    }
-
-    /**
-     * Inject the server configuration.
-     *
-     * @param array          $config   Configuration parameters for the server.
-     * @param Horde_Injector $injector The injector to use.
-     *
-     * @return NULL
-     */
-    static private function _setupConfiguration(
-        array $config,
-        Horde_Injector $injector
-    ) {
-        $injector->setInstance(
-            'Horde_Kolab_Server_Configuration', $config
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server_Factory_Conn.
-     *
-     * @param string         $factory  The class name of the conn connection
-     *                                 factory.
-     * @param Horde_Injector $injector The injector to use.
-     *
-     * @return NULL
-     */
-    static private function _setupConnectionFactory(
-        $factory,
-        Horde_Injector $injector
-    ) {
-        $injector->bindImplementation(
-            'Horde_Kolab_Server_Factory_Connection_Interface', $factory
-        );
-    }
-
-    /**
-     * Setup the machinery to create Horde_Kolab_Server objects.
-     *
-     * @return NULL
-     */
-    private function _setup()
-    {
-        $this->_setupObjects();
-        $this->_setupSearch();
-        $this->_setupSchema();
-        $this->_setupStructure();
-        $this->_setupConnection();
-        $this->_setupServer();
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server_Objects handler.
-     *
-     * @return NULL
-     */
-    private function _setupObjects()
-    {
-        $this->_injector->bindImplementation(
-            'Horde_Kolab_Server_Objects_Interface',
-            'Horde_Kolab_Server_Objects_Base'
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server_Search handler.
-     *
-     * @return NULL
-     */
-    private function _setupSearch()
-    {
-        $this->_injector->bindImplementation(
-            'Horde_Kolab_Server_Search_Interface',
-            'Horde_Kolab_Server_Search_Base'
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server_Schema handler.
-     *
-     * @return NULL
-     */
-    private function _setupSchema()
-    {
-        $this->_injector->bindImplementation(
-            'Horde_Kolab_Server_Schema_Interface',
-            'Horde_Kolab_Server_Schema_Base'
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server_Structure handler.
-     *
-     * @return NULL
-     */
-    private function _setupStructure()
-    {
-        $configuration = $this->getConfiguration();
-        if (!isset($configuration['structure']['driver'])) {
-            $driver = 'Horde_Kolab_Server_Structure_Kolab';
-        } else {
-            $driver = $configuration['structure']['driver'];
-        }
-
-        $this->_injector->bindImplementation(
-            'Horde_Kolab_Server_Structure_Interface', $driver
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server.
-     *
-     * @return NULL
-     */
-    private function _setupConnection()
-    {
-        $this->_injector->bindFactory(
-            'Horde_Kolab_Server_Connection_Interface',
-            'Horde_Kolab_Server_Factory_Connection_Injector',
-            'getConnection'
-        );
-    }
-
-    /**
-     * Setup the machinery to create a Horde_Kolab_Server.
-     *
-     * @return NULL
-     */
-    private function _setupServer()
-    {
-        $this->_injector->bindFactory(
-            'Horde_Kolab_Server_Interface',
-            'Horde_Kolab_Server_Factory_Injector',
-            'getServer'
-        );
-    }
-
-    /**
-     * Return the conn server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getConnectionFactory()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Factory_Connection_Interface'
-        );
-    }
-
-    /**
-     * Return the conn server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getConnection()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Connection_Interface'
-        );
-    }
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration()
-    {
-        return $this->_injector->getInstance('Horde_Kolab_Server_Configuration');
-    }
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer()
-    {
-        $configuration = $this->getConfiguration();
-        if (!isset($configuration['basedn'])) {
-            throw new Horde_Kolab_Server_Exception('The base DN is missing!');
-        }
-
-        $connection = $this->getConnection();
-
-        if (!isset($configuration['filter'])) {
-            $server = new Horde_Kolab_Server_Ldap_Standard(
-                $connection,
-                $configuration['basedn']
-            );
-        } else {
-            $server = new Horde_Kolab_Server_Ldap_Filtered(
-                $connection,
-                $configuration['basedn'],
-                $configuration['filter']
-            );
-        }
-        return $server;
-    }
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Objects_Interface'
-        );
-    }
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Structure_Interface'
-        );
-    }
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Search_Interface'
-        );
-    }
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Schema_Interface'
-        );
-    }
-
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite()
-    {
-        return $this->_injector->getInstance(
-            'Horde_Kolab_Server_Composite'
-        );
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Interface.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Interface.php
deleted file mode 100644 (file)
index 0810397..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-/**
- * The interface of Kolab server factories.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * The interface of Kolab server factories.
- *
- * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-interface Horde_Kolab_Server_Factory_Interface
-{
-    /**
-     * Returns a concrete Horde_Kolab_Server_Composite instance.
-     *
-     * @return Horde_Kolab_Server_Composite The newly created concrete
-     *                                      Horde_Kolab_Server_Composite
-     *                                      instance.
-     */
-    public function getComposite();
-
-    /**
-     * Returns the conn factory.
-     *
-     * @return Horde_Kolab_Server_Factory_Conn The connection factory.
-     */
-    public function getConnectionFactory();
-
-    /**
-     * Returns the server configuration parameters.
-     *
-     * @return array The configuration parameters.
-     */
-    public function getConfiguration();
-
-    /**
-     * Return the server connection that should be used.
-     *
-     * @return Horde_Kolab_Server The Horde_Kolab_Server connection.
-     */
-    public function getServer();
-
-    /**
-     * Return the server that should be used.
-     *
-     * @return Horde_Kolab_Server_Connection The connection.
-     */
-    public function getConnection();
-
-    /**
-     * Return the object handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Objects The handler for objects on the server.
-     */
-    public function getObjects();
-
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure();
-
-    /**
-     * Return the search handler that should be used.
-     *
-     * @return Horde_Kolab_Server_Search The search handler.
-     */
-    public function getSearch();
-
-    /**
-     * Return the db schema representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Schema The db schema representation.
-     */
-    public function getSchema();
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Kolab.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Factory/Kolab.php
deleted file mode 100644 (file)
index d107fa1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * A Kolab server factory providing the Kolab default.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * A Kolab server factory providing the Kolab default.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Factory_Kolab
-extends Horde_Kolab_Server_Factory_Default
-{
-    /**
-     * Return the structural representation that should be used.
-     *
-     * @return Horde_Kolab_Server_Structure The representation of the db
-     *                                      structure.
-     */
-    public function getStructure()
-    {
-        $structure = new Horde_Kolab_Server_Structure_Kolab();
-        return $structure;
-    }
-}
\ No newline at end of file
index ca01edc..671180b 100644 (file)
         <file name="Bindfailed.php" role="php" />
         <file name="Novalue.php" role="php" />
        </dir> <!-- /lib/Horde/Kolab/Server/Exception -->
-       <dir name="Factory">
-        <dir name="Connection">
-         <file name="Base.php" role="php" />
-         <file name="Configuration.php" role="php" />
-         <file name="Injector.php" role="php" />
-         <file name="Interface.php" role="php" />
-         <file name="Ldap.php" role="php" />
-         <file name="Mock.php" role="php" />
-        </dir> <!-- /lib/Horde/Kolab/Server/Factory/Connection -->
-        <dir name="Decorator">
-         <file name="Clean.php" role="php" />
-         <file name="Count.php" role="php" />
-         <file name="Log.php" role="php" />
-         <file name="Map.php" role="php" />
-        </dir> <!-- /lib/Horde/Kolab/Server/Factory/Decorator -->
-        <file name="Base.php" role="php" />
-        <file name="Configuration.php" role="php" />
-        <file name="Constructor.php" role="php" />
-        <file name="Default.php" role="php" />
-        <file name="Injector.php" role="php" />
-        <file name="Interface.php" role="php" />
-        <file name="Kolab.php" role="php" />
-       </dir> <!-- /lib/Horde/Kolab/Server/Factory -->
        <dir name="Ldap">
         <file name="Changes.php" role="php" />
         <file name="Filtered.php" role="php" />
           <file name="CleanTest.php" role="test" />
           <file name="LogTest.php" role="test" />
          </dir> <!-- /test/Horde/Kolab/Server/Class/Server/Decorator -->
-         <dir name="Factory">
-          <dir name="Connection">
-           <file name="ConfigurationTest.php" role="test" />
-           <file name="InjectorTest.php" role="test" />
-           <file name="LdapTest.php" role="test" />
-           <file name="MockTest.php" role="test" />
-          </dir> <!-- /test/Horde/Kolab/Server/Class/Server/Factory/Connection -->
-          <dir name="Decorator">
-           <file name="CleanTest.php" role="test" />
-           <file name="CountTest.php" role="test" />
-           <file name="LogTest.php" role="test" />
-           <file name="MapTest.php" role="test" />
-          </dir> <!-- /test/Horde/Kolab/Server/Class/Server/Factory/Decorator -->
-          <file name="ConfigurationTest.php" role="test" />
-          <file name="ConstructorTest.php" role="test" />
-          <file name="InjectorTest.php" role="test" />
-          <file name="KolabTest.php" role="test" />
-         </dir> <!-- /test/Horde/Kolab/Server/Class/Server/Factory -->
          <dir name="Ldap">
           <file name="ChangesTest.php" role="test" />
           <file name="FilteredTest.php" role="test" />
    <install as="Horde/Kolab/Server/Decorator/Map.php" name="lib/Horde/Kolab/Server/Decorator/Map.php" />
    <install as="Horde/Kolab/Server/Exception/Bindfailed.php" name="lib/Horde/Kolab/Server/Exception/Bindfailed.php" />
    <install as="Horde/Kolab/Server/Exception/Novalue.php" name="lib/Horde/Kolab/Server/Exception/Novalue.php" />
-   <install as="Horde/Kolab/Server/Factory/Base.php" name="lib/Horde/Kolab/Server/Factory/Base.php" />
-   <install as="Horde/Kolab/Server/Factory/Configuration.php" name="lib/Horde/Kolab/Server/Factory/Configuration.php" />
-   <install as="Horde/Kolab/Server/Factory/Constructor.php" name="lib/Horde/Kolab/Server/Factory/Constructor.php" />
-   <install as="Horde/Kolab/Server/Factory/Default.php" name="lib/Horde/Kolab/Server/Factory/Default.php" />
-   <install as="Horde/Kolab/Server/Factory/Injector.php" name="lib/Horde/Kolab/Server/Factory/Injector.php" />
-   <install as="Horde/Kolab/Server/Factory/Interface.php" name="lib/Horde/Kolab/Server/Factory/Interface.php" />
-   <install as="Horde/Kolab/Server/Factory/Kolab.php" name="lib/Horde/Kolab/Server/Factory/Kolab.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Base.php" name="lib/Horde/Kolab/Server/Factory/Connection/Base.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Configuration.php" name="lib/Horde/Kolab/Server/Factory/Connection/Configuration.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Injector.php" name="lib/Horde/Kolab/Server/Factory/Connection/Injector.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Interface.php" name="lib/Horde/Kolab/Server/Factory/Connection/Interface.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Ldap.php" name="lib/Horde/Kolab/Server/Factory/Connection/Ldap.php" />
-   <install as="Horde/Kolab/Server/Factory/Connection/Mock.php" name="lib/Horde/Kolab/Server/Factory/Connection/Mock.php" />
-   <install as="Horde/Kolab/Server/Factory/Decorator/Clean.php" name="lib/Horde/Kolab/Server/Factory/Decorator/Clean.php" />
-   <install as="Horde/Kolab/Server/Factory/Decorator/Count.php" name="lib/Horde/Kolab/Server/Factory/Decorator/Count.php" />
-   <install as="Horde/Kolab/Server/Factory/Decorator/Log.php" name="lib/Horde/Kolab/Server/Factory/Decorator/Log.php" />
-   <install as="Horde/Kolab/Server/Factory/Decorator/Map.php" name="lib/Horde/Kolab/Server/Factory/Decorator/Map.php" />
    <install as="Horde/Kolab/Server/Ldap/Changes.php" name="lib/Horde/Kolab/Server/Ldap/Changes.php" />
    <install as="Horde/Kolab/Server/Ldap/Filtered.php" name="lib/Horde/Kolab/Server/Ldap/Filtered.php" />
    <install as="Horde/Kolab/Server/Ldap/Standard.php" name="lib/Horde/Kolab/Server/Ldap/Standard.php" />
    <install as="Horde/Kolab/Server/Class/Server/Connection/Mock/LdapTest.php" name="test/Horde/Kolab/Server/Class/Server/Connection/Mock/LdapTest.php" />
    <install as="Horde/Kolab/Server/Class/Server/Decorator/CleanTest.php" name="test/Horde/Kolab/Server/Class/Server/Decorator/CleanTest.php" />
    <install as="Horde/Kolab/Server/Class/Server/Decorator/LogTest.php" name="test/Horde/Kolab/Server/Class/Server/Decorator/LogTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/KolabTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/KolabTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Connection/ConfigurationTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Connection/ConfigurationTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Connection/InjectorTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Connection/InjectorTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Connection/LdapTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Connection/LdapTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Connection/MockTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Connection/MockTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Decorator/CleanTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CleanTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Decorator/CountTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CountTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Decorator/LogTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Decorator/LogTest.php" />
-   <install as="Horde/Kolab/Server/Class/Server/Factory/Decorator/MapTest.php" name="test/Horde/Kolab/Server/Class/Server/Factory/Decorator/MapTest.php" />
    <install as="Horde/Kolab/Server/Class/Server/Ldap/ChangesTest.php" name="test/Horde/Kolab/Server/Class/Server/Ldap/ChangesTest.php" />
    <install as="Horde/Kolab/Server/Class/Server/Ldap/FilteredTest.php" name="test/Horde/Kolab/Server/Class/Server/Ldap/FilteredTest.php" />
    <install as="Horde/Kolab/Server/Class/Server/Ldap/StandardTest.php" name="test/Horde/Kolab/Server/Class/Server/Ldap/StandardTest.php" />
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php
deleted file mode 100644 (file)
index 6779271..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-/**
- * Test the configuration based server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
-
-/**
- * Test the configuration based server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_ConfigurationTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    public function testMethodGetserverHasResultLoggedServerIfALoggerWasProvidedInTheConfiguration()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('logger' => 'set', 'basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Decorator_Log', $factory->getServer()
-        );
-    }
-
-    public function testMethodGetserverHasResultMappedServerIfAMappedWasProvidedInTheConfiguration()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('map' => array(), 'basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Decorator_Map', $factory->getServer()
-        );
-    }
-
-    public function testMethodGetserverHasResultCleanerServerIfACleanedWasProvidedInTheConfiguration()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('cleanup' => true, 'basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Decorator_Clean', $factory->getServer()
-        );
-    }
-
-    public function testMethodConstructHasParametersArrayParameters()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-    }
-
-    public function testMethodGetconnectionfactoryHasResultServerconnectionfactory()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Factory_Connection_Interface',
-            $factory->getConnectionFactory()
-        );
-    }
-
-    public function testMethodGetserverHasResultServer()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Interface',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodGetconfigurationHasResultArray()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'array',
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodGetconnectionHasResultServerconnection()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Interface',
-            $factory->getConnection()
-        );
-    }
-
-    public function testMethodGetcompositeHasResultServercomposite()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Composite',
-            $factory->getComposite()
-        );
-    }
-
-    public function testMethodGetobjectsHasResultServerobjects()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Objects_Interface',
-            $factory->getObjects()
-        );
-    }
-
-    public function testMethodGetstructureHasresultServerstructure()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Structure_Interface',
-            $factory->getStructure()
-        );
-    }
-
-    public function testMethodGetsearchHasResultServersearch()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Search_Interface',
-            $factory->getSearch()
-        );
-    }
-
-    public function testMethodGetschemaHasResultServerschema()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Configuration(
-            array('basedn' => '')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Schema_Interface',
-            $factory->getSchema()
-        );
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/ConfigurationTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/ConfigurationTest.php
deleted file mode 100644 (file)
index 97d6f7d..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/**
- * Test the configuration based connection factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../../LdapTestCase.php';
-
-/**
- * Test the configuration based connection factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Connection_ConfigurationTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    public function testMethodConstructHasParameterArrayConfiguration()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            array('basedn' => 'a')
-        );
-    }
-
-    public function testMethodConstructHasPostconditionThatTheConfigurationWasSaved()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            array('basedn' => 'a')
-        );
-        $this->assertEquals(array('basedn' => 'a'), $factory->getConfiguration());
-    }
-
-    public function testMethodConstructHasResultArrayTheConfiguration()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            array('basedn' => 'a')
-        );
-        $this->assertType('array', $factory->getConfiguration());
-    }
-
-    public function testMethodConstructHasPostconditionThatTheConnectionFactoryHasBeenSet()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            array('mock' => true)
-        );
-        $this->assertType('Horde_Kolab_Server_Connection_Mock', $factory->getConnection());
-    }
-
-    public function testMethodGetconnectionHasResultMockConnectionIfConfiguredThatWay()
-    {
-        $this->testMethodConstructHasPostconditionThatTheConnectionFactoryHasBeenSet();
-    }
-
-    public function testMethodGetconnectionHasResultLdapConnectionIfConfiguredThatWay()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Connection_Configuration(
-            array('basedn' => 'a')
-        );
-        $this->assertType('Horde_Kolab_Server_Connection_Simpleldap', $factory->getConnection());
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/InjectorTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/InjectorTest.php
deleted file mode 100644 (file)
index 2657ab7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * Test the injector based connection factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the injector based connection factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Connection_InjectorTest
-extends PHPUnit_Framework_TestCase
-{
-    public function testMethodGetconnectionHasResultConnection()
-    {
-        $injector = new Horde_Injector(new Horde_Injector_TopLevel());
-        $injector->bindImplementation(
-            'Horde_Kolab_Server_Factory_Connection_Interface',
-            'Horde_Kolab_Server_Factory_Connection_Mock'
-        );
-        $injector->setInstance(
-            'Horde_Kolab_Server_Configuration',
-            array()
-        );
-        $factory = new Horde_Kolab_Server_Factory_Connection_Injector($injector);
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Interface',
-            $factory->getConnection()
-        );
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/LdapTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/LdapTest.php
deleted file mode 100644 (file)
index ee759c7..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-/**
- * Test the ldap connection factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../../LdapTestCase.php';
-
-/**
- * Test the ldap connection factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Connection_LdapTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    public function testMethodSetconfigurationHasPostconditionThatTheServerParameterWasRewritten()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        $factory->setConfiguration(
-            array(
-                'basedn' => 'test',
-                'server' => '1'
-            )
-        );
-        $this->assertEquals(
-            array(
-                'basedn' => 'test',
-                'host' => '1'
-            ),
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodSetconfigurationHasPostconditionThatThePhpdnParameterWasRewritten()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        $factory->setConfiguration(
-            array(
-                'basedn' => 'test',
-                'phpdn' => '1'
-            )
-        );
-        $this->assertEquals(
-            array(
-                'basedn' => 'test',
-                'binddn' => '1'
-            ),
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodSetconfigurationHasPostconditionThatThePhppwParameterWasRewritten()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        $factory->setConfiguration(
-            array(
-                'basedn' => 'test',
-                'phppw' => '1'
-            )
-        );
-        $this->assertEquals(
-            array(
-                'basedn' => 'test',
-                'bindpw' => '1'
-            ),
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodSetconfigurationThrowsExceptionIfTheBasednIsNotSet()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        try {
-            $factory->setConfiguration(array());
-            $this->fail('No exception!');
-        } catch (Horde_Kolab_Server_Exception $e) {
-            $this->assertEquals(
-                'The base DN is missing!',
-                $e->getMessage()
-            );
-        }
-    }
-
-    public function testMethodGetconnectionHasResultConnectionSimpleldap()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        $factory->setConfiguration(array('basedn' => 'test'));
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Simpleldap',
-            $factory->getConnection()
-        );
-    }
-
-    public function testMethodGetconnectionHasResultConnectionSplittedldapIfTheHostMasterIsSet()
-    {
-        $this->skipIfNoLdap();
-        $factory = new Horde_Kolab_Server_Factory_Connection_Ldap();
-        $factory->setConfiguration(array('basedn' => 'test', 'host_master' => 'dummy'));
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Splittedldap',
-            $factory->getConnection()
-        );
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/MockTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Connection/MockTest.php
deleted file mode 100644 (file)
index eb8dca1..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * Test the mock connection factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the mock connection factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Connection_MockTest
-extends PHPUnit_Framework_TestCase
-{
-    public function testMethodGetconfigurationHasResultArrayTheConnectionConfiguration()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Mock();
-        $factory->setConfiguration(array('basedn' => 'test'));
-        $this->assertEquals(
-            array('basedn' => 'test'),
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodSetconfigurationHasPostconditionThatTheConfigurationWasSaved()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Mock();
-        $factory->setConfiguration(array());
-        $this->assertEquals(
-            array(),
-            $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodGetconfigurationThrowsExceptionIfNoConfigurationHasBeenSet()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Mock();
-        try {
-            $factory->getConfiguration();
-            $this->fail('No exception!');
-        } catch (Horde_Kolab_Server_Exception $e) {
-            $this->assertEquals(
-                'The configuration has not been set!',
-                $e->getMessage()
-            );
-        }
-    }
-
-    public function testMethodGetconnectionHasResultConnectionmock()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Connection_Mock();
-        $factory->setConfiguration(
-            array(
-                'basedn' => 'test',
-                'data' => array()
-            )
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Mock',
-            $factory->getConnection()
-        );
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php
deleted file mode 100644 (file)
index 092b834..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/**
- * Test the mapping server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
-
-/**
- * Test the mapping server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_ConstructorTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    public function setUp()
-    {
-        parent::setUp();
-        $this->factory   = $this->getMock(
-            'Horde_Kolab_Server_Factory_Connection_Interface'
-        );
-        $this->objects   = $this->getMock(
-            'Horde_Kolab_Server_Objects_Interface'
-        );
-        $this->structure = $this->getMock(
-            'Horde_Kolab_Server_Structure_Interface'
-        );
-        $this->search    = $this->getMock(
-            'Horde_Kolab_Server_Search_Interface'
-        );
-        $this->schema    = $this->getMock(
-            'Horde_Kolab_Server_Schema_Interface'
-        );
-    }
-
-    public function testMethodConstructHasParametersFactoryObjectsStructureSearchSchemaConfig()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-    }
-
-    public function testMethodGetserverReturnsServer()
-    {
-        $this->skipIfNoLdap();
-        $this->factory->expects($this->once())
-            ->method('getConnection')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Connection_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertType('Horde_Kolab_Server_Interface', $factory->getServer());
-    }
-
-    public function testMethodGetconfigurationReturnsArrayConfiguration()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertEquals(
-            array('basedn' => 'test'), $factory->getConfiguration()
-        );
-    }
-
-    public function testMethodGetconnectionGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnection')
-            ->will(
-                $this->returnValue(
-                    $this->getMock('Horde_Kolab_Server_Connection_Interface')
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Interface',
-            $factory->getConnection()
-        );
-    }
-
-    public function testMethodGetcompositeReturnsComposite()
-    {
-        $this->skipIfNoLdap();
-        $this->factory->expects($this->once())
-            ->method('getConnection')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Connection_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Composite',
-            $factory->getComposite()
-        );
-    }
-
-    public function testMethodGetobjectsReturnsObjects()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertSame($this->objects, $factory->getObjects());
-    }
-
-    public function testMethodGetstructureReturnsStructure()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertSame($this->structure, $factory->getStructure());
-    }
-
-    public function testMethodGetsearchReturnsSearch()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertSame($this->search,  $factory->getSearch());
-    }
-
-    public function testMethodGetschemaGetsDelegated()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Constructor(
-            $this->factory, $this->objects, $this->structure,
-            $this->search, $this->schema, array('basedn' => 'test')
-        );
-        $this->assertSame($this->schema,  $factory->getSchema());
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CleanTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CleanTest.php
deleted file mode 100644 (file)
index 2282119..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-/**
- * Test the cleaner server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the cleaner server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Decorator_CleanTest
-extends PHPUnit_Framework_TestCase
-{
-    public function setUp()
-    {
-        $this->factory = $this->getMock(
-            'Horde_Kolab_Server_Factory_Interface'
-        );
-    }
-
-    public function testMethodGetserverHasResultCleanerServerIfACleanedWasProvidedInTheConfiguration()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array('cleanup' => true)
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Decorator_Clean',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodConstructHasParametersFactory()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory
-        );
-    }
-
-    public function testMethodGetconnectionfactoryGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnectionFactory');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getConnectionFactory();
-    }
-
-    public function testMethodGetserverGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getServer();
-    }
-
-    public function testMethodGetconfigurationGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConfiguration');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getConfiguration();
-    }
-
-    public function testMethodGetconnectionGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnection');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getConnection();
-    }
-
-    public function testMethodGetcompositeGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getComposite');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getComposite();
-    }
-
-    public function testMethodGetobjectsGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getObjects');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getObjects();
-    }
-
-    public function testMethodGetstructureGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getStructure');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getStructure();
-    }
-
-    public function testMethodGetsearchGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSearch');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getSearch();
-    }
-
-    public function testMethodGetschemaGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSchema');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Clean(
-            $this->factory, array()
-        );
-        $factory->getSchema();
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CountTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/CountTest.php
deleted file mode 100644 (file)
index c2212b0..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Test the count decorator server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the count decorator server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Decorator_CountTest
-extends PHPUnit_Framework_TestCase
-{
-    public function setUp()
-    {
-        $this->factory = $this->getMock(
-            'Horde_Kolab_Server_Factory_Interface'
-        );
-    }
-
-    public function testMethodGetserverHasResultCountedServer()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $this->assertType('Horde_Kolab_Server_Decorator_Count', $factory->getServer());
-    }
-
-    public function testMethodConstructHasParametersFactoryAndMixedLoggerParameter()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-    }
-
-    public function testMethodGetconnectionfactoryHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnectionFactory');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getConnectionFactory();
-    }
-
-    public function testMethodGetserverHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getServer();
-    }
-
-    public function testMethodGetconfigurationHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConfiguration');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getConfiguration();
-    }
-
-    public function testMethodGetconnectionHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnection');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getConnection();
-    }
-
-    public function testMethodGetcompositeHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getComposite');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getComposite();
-    }
-
-    public function testMethodGetobjectsHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getObjects');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getObjects();
-    }
-
-    public function testMethodGetstructureHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getStructure');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getStructure();
-    }
-
-    public function testMethodGetsearchHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSearch');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getSearch();
-    }
-
-    public function testMethodGetschemaHasPostconditionThatTheCallWasDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSchema');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Count(
-            $this->factory, 'logger'
-        );
-        $factory->getSchema();
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/LogTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/LogTest.php
deleted file mode 100644 (file)
index 696aa63..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Test the log decorator server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the log decorator server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Decorator_LogTest
-extends PHPUnit_Framework_TestCase
-{
-    public function setUp()
-    {
-        $this->factory = $this->getMock(
-            'Horde_Kolab_Server_Factory_Interface'
-        );
-    }
-
-    public function testMethodGetserverHasResultLoggedServerIfALoggerWasProvidedInTheConfiguration()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $this->assertType('Horde_Kolab_Server_Decorator_Log', $factory->getServer());
-    }
-
-    public function testMethodConstructHasParametersFactoryAndMixedLoggerParameter()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-    }
-
-    public function testMethodGetconnectionfactoryGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnectionFactory');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getConnectionFactory();
-    }
-
-    public function testMethodGetserverGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getServer();
-    }
-
-    public function testMethodGetconfigurationGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConfiguration');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getConfiguration();
-    }
-
-    public function testMethodGetconnectionGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnection');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getConnection();
-    }
-
-    public function testMethodGetcompositeGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getComposite');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getComposite();
-    }
-
-    public function testMethodGetobjectsGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getObjects');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getObjects();
-    }
-
-    public function testMethodGetstructureGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getStructure');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getStructure();
-    }
-
-    public function testMethodGetsearchGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSearch');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getSearch();
-    }
-
-    public function testMethodGetschemaGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSchema');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Log(
-            $this->factory, 'logger'
-        );
-        $factory->getSchema();
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/MapTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Decorator/MapTest.php
deleted file mode 100644 (file)
index 8ccbc6f..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/**
- * Test the mapping server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../../../Autoload.php';
-
-/**
- * Test the mapping server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_Decorator_MapTest
-extends PHPUnit_Framework_TestCase
-{
-    public function setUp()
-    {
-        $this->factory = $this->getMock(
-            'Horde_Kolab_Server_Factory_Interface'
-        );
-    }
-
-    public function testMethodGetserverHasResultMappedServer()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock('Horde_Kolab_Server_Interface')
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Decorator_Map',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodConstructHasParametersFactoryAndArrayMapping()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-    }
-
-    public function testMethodGetconnectionfactoryGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnectionFactory');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getConnectionFactory();
-    }
-
-    public function testMethodGetserverGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getServer')
-            ->will(
-                $this->returnValue(
-                    $this->getMock(
-                        'Horde_Kolab_Server_Interface'
-                    )
-                )
-            );
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getServer();
-    }
-
-    public function testMethodGetconfigurationGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConfiguration');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getConfiguration();
-    }
-
-    public function testMethodGetconnectionGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getConnection');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getConnection();
-    }
-
-    public function testMethodGetcompositeGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getComposite');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getComposite();
-    }
-
-    public function testMethodGetobjectsGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getObjects');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getObjects();
-    }
-
-    public function testMethodGetstructureGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getStructure');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getStructure();
-    }
-
-    public function testMethodGetsearchGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSearch');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getSearch();
-    }
-
-    public function testMethodGetschemaGetsDelegated()
-    {
-        $this->factory->expects($this->once())
-            ->method('getSchema');
-        $factory = new Horde_Kolab_Server_Factory_Decorator_Map(
-            $this->factory, array()
-        );
-        $factory->getSchema();
-    }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php
deleted file mode 100644 (file)
index 41cb69e..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-/**
- * Test the injector based server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
-
-/**
- * Test the injector based server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_InjectorTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    private function _getFactory(array $configuration = array())
-    {
-        $injector = new Horde_Injector(new Horde_Injector_TopLevel());
-        Horde_Kolab_Server_Factory_Injector::setup(
-            'Horde_Kolab_Server_Factory_Connection_Mock',
-            $configuration,
-            $injector
-        );
-        return $injector->getInstance(
-            'Horde_Kolab_Server_Factory_Injector'
-        );
-    }
-
-    public function testMethodGetconnectionfactoryHasResultConnectionfactory()
-    {
-        $this->assertType(
-            'Horde_Kolab_Server_Factory_Connection_Interface',
-            $this->_getFactory(array())->getConnectionFactory()
-        );
-    }
-
-    public function testMethodGetconnectionHasResultConnection()
-    {
-        $factory = $this->_getFactory(array());
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Interface',
-            $factory->getConnection()
-        );
-    }
-
-    public function testMethodGetserverHasResultServerldapstandard()
-    {
-        $this->skipIfNoLdap();
-        $factory = $this->_getFactory(array('basedn' => 'test'));
-        $this->assertType(
-            'Horde_Kolab_Server_Ldap_Standard',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodGetserverThrowsExceptionIfTheBaseDnIsMissingInTheConfiguration()
-    {
-        $factory = $this->_getFactory(array());
-        try {
-            $factory->getServer();
-            $this->fail('No exception!');
-        } catch (Horde_Kolab_Server_Exception $e) {
-            $this->assertEquals(
-                'The base DN is missing!',
-                $e->getMessage()
-            );
-        }
-    }
-
-    public function testMethodGetserverHasResultServerldapFilteredIfAFilterWasSet()
-    {
-        $this->skipIfNoLdap();
-        $factory = $this->_getFactory(array('filter' => 'test', 'basedn' => 'test'));
-        $this->assertType(
-            'Horde_Kolab_Server_Ldap_Filtered',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodGetobjectsHasResultObjects()
-    {
-        $factory = $this->_getFactory(array());
-        $this->assertType(
-            'Horde_Kolab_Server_Objects_Interface',
-            $factory->getObjects()
-        );
-    }
-
-    public function testMethodGetstructureHasResultStructureKolab()
-    {
-        $factory = $this->_getFactory(array());
-        $this->assertType(
-            'Horde_Kolab_Server_Structure_Kolab',
-            $factory->getStructure()
-        );
-    }
-
-    public function testMethodGetstructureHasResultStructureLdapIfConfiguredThatWay()
-    {
-        $factory = $this->_getFactory(
-            array(
-                'structure' => array(
-                    'driver' => 'Horde_Kolab_Server_Structure_Ldap'
-                )
-            )
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Structure_Ldap',
-            $factory->getStructure()
-        );
-    }
-
-    public function testMethodGetsearchHasResultSearch()
-    {
-        $factory = $this->_getFactory(array());
-        $this->assertType(
-            'Horde_Kolab_Server_Search_Interface',
-            $factory->getSearch()
-        );
-    }
-
-    public function testMethodGetschemaHasResultSchema()
-    {
-        $factory = $this->_getFactory(array());
-        $this->assertType(
-            'Horde_Kolab_Server_Schema_Interface',
-            $factory->getSchema()
-        );
-    }
-
-    public function testMethodGetcompositeHasResultComposite()
-    {
-        $this->skipIfNoLdap();
-        $factory = $this->_getFactory(array('basedn' => 'test'));
-        $this->assertType(
-            'Horde_Kolab_Server_Composite',
-            $factory->getComposite()
-        );
-    }
-
-}
\ No newline at end of file
diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/KolabTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/KolabTest.php
deleted file mode 100644 (file)
index 5b4bf0a..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/**
- * Test the default Kolab server factory.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-
-/**
- * Require our basic test case definition
- */
-require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
-
-/**
- * Test the default Kolab server factory.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * 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  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
- */
-class Horde_Kolab_Server_Class_Server_Factory_KolabTest
-extends Horde_Kolab_Server_LdapTestCase
-{
-    public function setUp()
-    {
-        $this->conn_factory = $this->getMock(
-            'Horde_Kolab_Server_Factory_Connection_Interface'
-        );
-        $this->connection = $this->getMock(
-            'Horde_Kolab_Server_Connection_Interface'
-        );
-    }
-
-    public function testMethodConstructHasParametersConnectionfactoryAndArrayParameters()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-    }
-
-    public function testMethodGetconnectionfactoryHasResultTheStoredConnectionfactory()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertSame($this->conn_factory, $factory->getConnectionFactory());
-    }
-
-    public function testMethodGetconfigurationHasResultTheStoredConfigurationParameters()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array('a' => 'a')
-        );
-        $this->assertEquals(array('a' => 'a'), $factory->getConfiguration());
-    }
-
-    public function testMethodGetconnectionHasResultConnection()
-    {
-        $this->conn_factory->expects($this->once())
-            ->method('setConfiguration')
-            ->with(array());
-        $this->conn_factory->expects($this->once())
-            ->method('getConnection')
-            ->will($this->returnValue($this->connection));
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Connection_Interface',
-            $factory->getConnection()
-        );
-    }
-
-    public function testMethodGetobjectsHasResultObjectsbase()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Objects_Base',
-            $factory->getObjects()
-        );
-    }
-
-    public function testMethodGetsearchHasResultSearchbase()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Search_Base',
-            $factory->getSearch()
-        );
-    }
-
-    public function testMethodGetsearchHasResultSchemabase()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Schema_Base',
-            $factory->getSchema()
-        );
-    }
-
-    public function testMethodGetstructureHasResultStructurekolab()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Structure_Kolab',
-            $factory->getStructure()
-        );
-    }
-
-    public function testMethodGetserverHasResultServerldapstandard()
-    {
-        $this->skipIfNoLdap();
-        $this->conn_factory->expects($this->once())
-            ->method('getConnection')
-            ->will($this->returnValue($this->connection));
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array('basedn' => 'test')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Ldap_Standard',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodGetserverHasResultServerldapfilteredIfTheFilterOptionIsSet()
-    {
-        $this->skipIfNoLdap();
-        $this->conn_factory->expects($this->once())
-            ->method('getConnection')
-            ->will($this->returnValue($this->connection));
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array('basedn' => 'test', 'filter' => 'a')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Ldap_Filtered',
-            $factory->getServer()
-        );
-    }
-
-    public function testMethodGetserverThrowsExceptionIfTheBasednIsMissingInTheConfiguration()
-    {
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array()
-        );
-        try {
-            $factory->getServer();
-            $this->fail('No exception!');
-        } catch (Horde_Kolab_Server_Exception $e) {
-            $this->assertEquals('The base DN is missing', $e->getMessage());
-        }
-    }
-
-    public function testMethodGetcompositeHasResultComposite()
-    {
-        $this->skipIfNoLdap();
-        $this->conn_factory->expects($this->once())
-            ->method('getConnection')
-            ->will($this->returnValue($this->connection));
-        $factory = new Horde_Kolab_Server_Factory_Kolab(
-            $this->conn_factory, array('basedn' => 'test')
-        );
-        $this->assertType(
-            'Horde_Kolab_Server_Composite',
-            $factory->getComposite()
-        );
-    }
-
-
-}
\ No newline at end of file
index 5506693..ad5d138 100644 (file)
@@ -35,23 +35,32 @@ extends Horde_Kolab_Server_LdapTestCase
 {
     public function setUp()
     {
-        $conf['basedn'] = 'dc=test';
-        $conf['mock']   = true;
-        $conf['data']   = array(
-            'dn=user,dc=test' => array(
-                'dn' => 'dn=user,dc=test',
-                'data' => array(
-                    'uid' => array('user'),
-                    'mail' => array('user@example.org'),
-                    'objectClass' => array('top', 'kolabInetOrgPerson'),
+        $connection = new Horde_Kolab_Server_Connection_Mock(
+            new Horde_Kolab_Server_Connection_Mock_Ldap(
+                array('basedn' => 'dc=test'),
+                array(
+                    'dn=user,dc=test' => array(
+                        'dn' => 'dn=user,dc=test',
+                        'data' => array(
+                            'uid' => array('user'),
+                            'mail' => array('user@example.org'),
+                            'objectClass' => array('top', 'kolabInetOrgPerson'),
+                        )
+                    )
                 )
             )
         );
-        $server_factory = new Horde_Kolab_Server_Factory_Configuration(
-            $conf
-        );
 
-        $this->composite = $server_factory->getComposite();
+        $this->composite = new Horde_Kolab_Server_Composite(
+            new Horde_Kolab_Server_Ldap_Standard(
+                $connection,
+                'dc=test'
+            ),
+            new Horde_Kolab_Server_Objects_Base(),
+            new Horde_Kolab_Server_Structure_Kolab(),
+            new Horde_Kolab_Server_Search_Base(),
+            new Horde_Kolab_Server_Schema_Base()
+        );
         $this->composite->server->connectGuid();
     }
 
index 05604f0..37eb9c8 100644 (file)
@@ -88,7 +88,7 @@ class Horde_Share_kolab extends Horde_Share {
     public function getSession()
     {
         if (!isset($this->_session)) {
-            $this->_session = Horde_Kolab_Session_Singleton::singleton();
+            $this->_session = $GLOBALS['injector']->getInstance('Horde_Kolab_Session');
         }
         return $this->_session;
     }
@@ -470,7 +470,7 @@ class Horde_Share_Object_kolab extends Horde_Share_Object {
     public function getSession()
     {
         if (!isset($this->_session)) {
-            $this->_session = Horde_Kolab_Session_Singleton::singleton();
+            $this->_session = $GLOBALS['injector']->getInstance('Horde_Kolab_Session');
         }
         return $this->_session;
     }