Complete testing.
authorGunnar Wrobel <p@rdus.de>
Wed, 4 Nov 2009 09:14:22 +0000 (10:14 +0100)
committerGunnar Wrobel <p@rdus.de>
Wed, 4 Nov 2009 09:14:22 +0000 (10:14 +0100)
framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php
framework/Kolab_Session/package.xml
framework/Kolab_Session/test/Horde/Kolab/Session/Class/SingletonTest.php [deleted file]
framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SingletonTest.php [new file with mode: 0644]

index 839c706..add352c 100644 (file)
@@ -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'];
index 0eb77ba..2049419 100644 (file)
@@ -105,7 +105,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
          <file name="LoggedTest.php" role="test" />
         </dir> <!-- /test/Horde/Kolab/Session/Class/Factory -->
         <file name="LoggedTest.php" role="test" />
-        <file name="SingletonTest.php" role="test" />
         <dir name="Storage">
          <file name="MockTest.php" role="test" />
          <file name="SessionobjectsTest.php" role="test" />
@@ -119,6 +118,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
        <dir name="Integration">
         <file name="AnonymousTest.php" role="test" />
         <file name="SessionTest.php" role="test" />
+        <file name="SingletonTest.php" role="test" />
         <file name="ValidTest.php" role="test" />
        </dir> <!-- /test/Horde/Kolab/Session/Integration -->
        <file name="phpunit.xml" role="test" />
@@ -205,7 +205,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="test/Horde/Kolab/Session/Class/Factory/InjectorTest.php" as="Horde/Kolab/Session/Class/Factory/InjectorTest.php" />
    <install name="test/Horde/Kolab/Session/Class/Factory/LoggedTest.php" as="Horde/Kolab/Session/Class/Factory/LoggedTest.php" />
    <install name="test/Horde/Kolab/Session/Class/LoggedTest.php" as="Horde/Kolab/Session/Class/LoggedTest.php" />
-   <install name="test/Horde/Kolab/Session/Class/SingletonTest.php" as="Horde/Kolab/Session/Class/SingletonTest.php" />
    <install name="test/Horde/Kolab/Session/Class/Storage/MockTest.php" as="Horde/Kolab/Session/Class/Storage/MockTest.php" />
    <install name="test/Horde/Kolab/Session/Class/Storage/SessionobjectsTest.php" as="Horde/Kolab/Session/Class/Storage/SessionobjectsTest.php" />
    <install name="test/Horde/Kolab/Session/Class/StoredTest.php" as="Horde/Kolab/Session/Class/StoredTest.php" />
@@ -213,6 +212,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="test/Horde/Kolab/Session/Class/Valid/LoggedTest.php" as="Horde/Kolab/Session/Class/Valid/LoggedTest.php" />
    <install name="test/Horde/Kolab/Session/Integration/AnonymousTest.php" as="Horde/Kolab/Session/Integration/AnonymousTest.php" />
    <install name="test/Horde/Kolab/Session/Integration/SessionTest.php" as="Horde/Kolab/Session/Integration/SessionTest.php" />
+   <install name="test/Horde/Kolab/Session/Integration/SingletonTest.php" as="Horde/Kolab/Session/Integration/SingletonTest.php" />
    <install name="test/Horde/Kolab/Session/Integration/ValidTest.php" as="Horde/Kolab/Session/Integration/ValidTest.php" />
    <install name="test/Horde/Kolab/Session/phpunit.xml" as="Horde/Kolab/Session/phpunit.php" />
    <install name="test/Horde/Kolab/Session/SessionTestCase.php" as="Horde/Kolab/Session/SessionTestCase.php" />
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 (file)
index bf12f46..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * Test the Kolab session singleton pattern.
- *
- * PHP version 5
- *
- * @category Kolab
- * @package  Kolab_Session
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @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 <wrobel@pardus.de>
- * @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 (file)
index 0000000..ecd608d
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Test the Kolab session singleton pattern.
+ *
+ * PHP version 5
+ *
+ * @category Kolab
+ * @package  Kolab_Session
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @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 <wrobel@pardus.de>
+ * @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