Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Gunnar Wrobel (wrobel@pardus.de)
Example #1
0
 /**
  * Test creating the server object.
  *
  * @return NULL
  */
 public function testCreation()
 {
     try {
         $injector = new Horde_Injector(new Horde_Injector_TopLevel());
         $config = new stdClass();
         $config->driver = 'dummy';
         $injector->setInstance('Horde_Kolab_Server_Config', $config);
         $injector->bindFactory('Horde_Kolab_Server_Structure', 'Horde_Kolab_Server_Factory', 'getStructure');
         $injector->bindFactory('Horde_Kolab_Server', 'Horde_Kolab_Server_Factory', 'getServer');
         Horde_Kolab_Server_Factory::getServer($injector);
         $this->assertFail('No error!');
     } catch (Horde_Kolab_Server_Exception $e) {
         $this->assertEquals('Server type definition "Horde_Kolab_Server_Dummy" missing.', $e->getMessage());
     }
 }
Example #2
0
 /**
  * Creates the connection to the user database.
  *
  * @param Horde_Injector $injector The injector provides the required
  *                                 configuration.
  *
  * @return Horde_Kolab_Server_Composite The connection to the user DB.
  */
 public function getUserDb(Horde_Injector $injector)
 {
     $configuration = $injector->getInstance('Horde_Kolab_Filter_Configuration');
     $conf = $configuration->getConf();
     $factory = new Horde_Kolab_Server_Factory();
     return new Horde_Kolab_Server_Composite($factory->getServer($conf['server']), new Horde_Kolab_Server_Objects_Base(), new Horde_Kolab_Server_Structure_Kolab(), new Horde_Kolab_Server_Search_Base(), new Horde_Kolab_Server_Schema_Base());
 }