From: Gunnar Wrobel Date: Wed, 4 Nov 2009 09:14:22 +0000 (+0100) Subject: Complete testing. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=73a97eb03d608d29ec6270c46a24f16b31c5267d;p=horde.git Complete testing. --- diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php index 839c7066e..add352c6f 100644 --- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php +++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php @@ -199,7 +199,7 @@ class Horde_Kolab_Session_Base implements Horde_Kolab_Session Horde_Kolab_Server_Object_Interface $user ) { try { - $this->_user_name = $user->getExternal('Fnln'); + $this->_user_name = $user->getExternal('Firstnamelastname'); } catch (Horde_Kolab_Server_Exception_Novalue $e) { $this->_user_name = $this->_user_id; } @@ -216,7 +216,7 @@ class Horde_Kolab_Session_Base implements Horde_Kolab_Session Horde_Kolab_Server_Object_Interface $user ) { try { - $this->_imap_server = $user->getExternal('KolabHomeserver'); + $this->_imap_server = $user->getExternal('Kolabhomeserver'); } catch (Horde_Kolab_Server_Exception_Novalue $e) { if (isset($this->_params['imap']['server'])) { $this->_imap_server = $this->_params['imap']['server']; @@ -237,7 +237,7 @@ class Horde_Kolab_Session_Base implements Horde_Kolab_Session Horde_Kolab_Server_Object_Interface $user ) { try { - $fb_server = $user->getExternal('KolabFreebusyHost'); + $fb_server = $user->getExternal('Kolabfreebusyhost'); } catch (Horde_Kolab_Server_Exception_Novalue $e) { if (isset($this->_params['freebusy']['url'])) { $this->_freebusy_server = $this->_params['freebusy']['url']; diff --git a/framework/Kolab_Session/package.xml b/framework/Kolab_Session/package.xml index 0eb77ba5f..2049419fc 100644 --- a/framework/Kolab_Session/package.xml +++ b/framework/Kolab_Session/package.xml @@ -105,7 +105,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -119,6 +118,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> + @@ -205,7 +205,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -213,6 +212,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> + diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/SingletonTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/SingletonTest.php deleted file mode 100644 index bf12f4677..000000000 --- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/SingletonTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Session - */ - -/** - * Prepare the test setup. - */ -require_once dirname(__FILE__) . '/../Autoload.php'; - -/** - * Test the Kolab session singleton pattern. - * - * Copyright 2009 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_Session - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Session - */ -class Horde_Kolab_Session_Class_SingletonTest extends Horde_Kolab_Session_SessionTestCase -{ - public function setUp() - { - global $conf; - - /** Provide a minimal configuration for the server */ - $conf['kolab']['ldap']['basedn'] = ''; - } - - public function testMethodSingletonHasResultHordekolabsession() - { - $this->assertType( - 'Horde_Kolab_Session', - Horde_Kolab_Session_Singleton::singleton( - 'user', array('password' => 'pass') - ) - ); - } - - public function testMethodSingletonHasResultHordekolabsessionAlwaysTheSameIfTheSessionIsValid() - { - $session1 = Horde_Kolab_Session_Singleton::singleton( - 'user', array('password' => 'pass') - ); - $session2 = Horde_Kolab_Session_Singleton::singleton( - 'user', array('password' => 'pass') - ); - $this->assertSame($session1, $session2); - } -} \ No newline at end of file diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SingletonTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SingletonTest.php new file mode 100644 index 000000000..ecd608da5 --- /dev/null +++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SingletonTest.php @@ -0,0 +1,75 @@ + + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Session + */ + +/** + * Prepare the test setup. + */ +require_once dirname(__FILE__) . '/../Autoload.php'; + +/** + * Test the Kolab session singleton pattern. + * + * Copyright 2009 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_Session + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Session + */ +class Horde_Kolab_Session_Integration_SingletonTest extends Horde_Kolab_Session_SessionTestCase +{ + public function setUp() + { + global $conf; + + /** Provide a minimal configuration for the server */ + $conf['kolab']['ldap']['basedn'] = 'dc=test'; + $conf['kolab']['ldap']['mock'] = true; + $conf['kolab']['ldap']['data'] = array( + 'dn=user,dc=test' => array( + 'dn' => 'dn=user,dc=test', + 'data' => array( + 'uid' => array('user'), + 'mail' => array('user@example.org'), + 'userPassword' => array('pass'), + 'objectClass' => array('top', 'kolabInetOrgPerson'), + ) + ) + ); + } + + public function testMethodSingletonHasResultHordekolabsession() + { + $this->assertType( + 'Horde_Kolab_Session', + Horde_Kolab_Session_Singleton::singleton( + 'user', array('password' => 'pass') + ) + ); + } + + public function testMethodSingletonHasResultHordekolabsessionAlwaysTheSameIfTheSessionIsValid() + { + $session1 = Horde_Kolab_Session_Singleton::singleton( + 'user', array('password' => 'pass') + ); + $session2 = Horde_Kolab_Session_Singleton::singleton( + 'user', array('password' => 'pass') + ); + $this->assertSame($session1, $session2); + } +} \ No newline at end of file