This needs to be tested and implemented in the Auth module.
authorGunnar Wrobel <p@rdus.de>
Wed, 17 Mar 2010 07:51:30 +0000 (08:51 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Wed, 17 Mar 2010 20:23:32 +0000 (21:23 +0100)
framework/Auth/test/Horde/Auth/Kolab/Integration/AuthTest.php
framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SessionTest.php

index 73a305f..9202d71 100644 (file)
@@ -140,6 +140,100 @@ class Horde_Auth_Kolab_Integration_AuthTest extends PHPUnit_Framework_TestCase
             $auth->authenticate('user', array('password' => 'pass'), false)
         );
     }
+
+    /* /\** */
+    /*  * Test group based login allow implemention. */
+    /*  * */
+    /*  * @return NULL */
+    /*  *\/ */
+    /* public function testLoginAllow() */
+    /* { */
+    /*     global $conf; */
+    /*     $conf['kolab']['server']['allow_group'] = 'group2@example.org'; */
+    /*     $conf['kolab']['server']['deny_group'] = null; */
+
+    /*     $this->markTestSkipped(); */
+    /*     $server = &$this->prepareEmptyKolabServer(); */
+    /*     $result = $server->add($this->provideBasicUserOne()); */
+    /*     $this->assertNoError($result); */
+    /*     $result = $server->add($this->provideBasicUserTwo()); */
+    /*     $this->assertNoError($result); */
+    /*     $groups = $this->validGroups(); */
+    /*     foreach ($groups as $group) { */
+    /*         $result = $server->add($group[0]); */
+    /*         $this->assertNoError($result); */
+    /*     } */
+
+    /*     $session = Horde_Kolab_Session::singleton( */
+    /*         'wrobel', */
+    /*         array('password' => 'none'), */
+    /*         true */
+    /*     ); */
+
+    /*     $this->assertNoError($session->auth); */
+    /*     $this->assertEquals('wrobel@example.org', $session->user_mail); */
+
+    /*     try { */
+    /*         $session = Horde_Kolab_Session::singleton( */
+    /*             'test', */
+    /*             array('password' => 'test'), */
+    /*             true */
+    /*         ); */
+    /*     } catch (Horde_Kolab_Session_Exception $e) { */
+    /*         $this->assertError( */
+    /*             $e, 'You are no member of a group that may login on this server.' */
+    /*         ); */
+    /*     } */
+    /*     // FIXME: Ensure that the session gets overwritten */
+    /*     //$this->assertTrue(empty($session->user_mail)); */
+    /* } */
+
+    /* /\** */
+    /*  * Test group based login deny implemention. */
+    /*  * */
+    /*  * @return NULL */
+    /*  *\/ */
+    /* public function testLoginDeny() */
+    /* { */
+    /*     global $conf; */
+    /*     $conf['kolab']['server']['deny_group'] = 'group2@example.org'; */
+    /*     unset($conf['kolab']['server']['allow_group']); */
+
+    /*     $this->markTestSkipped(); */
+    /*     $server = &$this->prepareEmptyKolabServer(); */
+    /*     $result = $server->add($this->provideBasicUserOne()); */
+    /*     $this->assertNoError($result); */
+    /*     $result = $server->add($this->provideBasicUserTwo()); */
+    /*     $this->assertNoError($result); */
+    /*     $groups = $this->validGroups(); */
+    /*     foreach ($groups as $group) { */
+    /*         $result = $server->add($group[0]); */
+    /*         $this->assertNoError($result); */
+    /*     } */
+
+    /*     $session = Horde_Kolab_Session::singleton( */
+    /*         'test', */
+    /*         array('password' => 'test'), */
+    /*         true */
+    /*     ); */
+
+    /*     $this->assertNoError($session->auth); */
+    /*     $this->assertEquals('test@example.org', $session->user_mail); */
+
+    /*     try { */
+    /*         $session = Horde_Kolab_Session::singleton( */
+    /*             'wrobel', */
+    /*             array('password' => 'none'), */
+    /*             true */
+    /*         ); */
+    /*     } catch (Horde_Kolab_Session_Exception $e) { */
+    /*         $this->assertError( */
+    /*             $e, 'You are member of a group that may not login on this server.' */
+    /*         ); */
+    /*     } */
+    /*     // FIXME: Ensure that the session gets overwritten */
+    /*     //$this->assertTrue(empty($session->user_mail)); */
+    /* } */
 }
 
 class Horde_Auth_Kolab_Dummy extends Horde_Auth_Kolab
index e4685c5..66ec59e 100644 (file)
@@ -34,16 +34,6 @@ class Horde_Kolab_Session_Integration_SessionTest
 extends Horde_Kolab_Session_SessionTestCase
 {
     /**
-     * Setup function.
-     *
-     * @return NULL.
-     */
-    protected function setUp()
-    {
-        $this->markTestIncomplete('Needs to be fixed');
-    }
-
-    /**
      * Test class construction.
      *
      * @return NULL
@@ -139,98 +129,5 @@ extends Horde_Kolab_Session_SessionTestCase
         $this->assertEquals('', $session->freebusy_server);
     }
 
-    /**
-     * Test group based login allow implemention.
-     *
-     * @return NULL
-     */
-    public function testLoginAllow()
-    {
-        global $conf;
-        $conf['kolab']['server']['allow_group'] = 'group2@example.org';
-        $conf['kolab']['server']['deny_group'] = null;
-
-        $this->markTestSkipped();
-        $server = &$this->prepareEmptyKolabServer();
-        $result = $server->add($this->provideBasicUserOne());
-        $this->assertNoError($result);
-        $result = $server->add($this->provideBasicUserTwo());
-        $this->assertNoError($result);
-        $groups = $this->validGroups();
-        foreach ($groups as $group) {
-            $result = $server->add($group[0]);
-            $this->assertNoError($result);
-        }
-
-        $session = Horde_Kolab_Session::singleton(
-            'wrobel',
-            array('password' => 'none'),
-            true
-        );
-
-        $this->assertNoError($session->auth);
-        $this->assertEquals('wrobel@example.org', $session->user_mail);
-
-        try {
-            $session = Horde_Kolab_Session::singleton(
-                'test',
-                array('password' => 'test'),
-                true
-            );
-        } catch (Horde_Kolab_Session_Exception $e) {
-            $this->assertError(
-                $e, 'You are no member of a group that may login on this server.'
-            );
-        }
-        // FIXME: Ensure that the session gets overwritten
-        //$this->assertTrue(empty($session->user_mail));
-    }
-
-    /**
-     * Test group based login deny implemention.
-     *
-     * @return NULL
-     */
-    public function testLoginDeny()
-    {
-        global $conf;
-        $conf['kolab']['server']['deny_group'] = 'group2@example.org';
-        unset($conf['kolab']['server']['allow_group']);
-
-        $this->markTestSkipped();
-        $server = &$this->prepareEmptyKolabServer();
-        $result = $server->add($this->provideBasicUserOne());
-        $this->assertNoError($result);
-        $result = $server->add($this->provideBasicUserTwo());
-        $this->assertNoError($result);
-        $groups = $this->validGroups();
-        foreach ($groups as $group) {
-            $result = $server->add($group[0]);
-            $this->assertNoError($result);
-        }
-
-        $session = Horde_Kolab_Session::singleton(
-            'test',
-            array('password' => 'test'),
-            true
-        );
-
-        $this->assertNoError($session->auth);
-        $this->assertEquals('test@example.org', $session->user_mail);
-
-        try {
-            $session = Horde_Kolab_Session::singleton(
-                'wrobel',
-                array('password' => 'none'),
-                true
-            );
-        } catch (Horde_Kolab_Session_Exception $e) {
-            $this->assertError(
-                $e, 'You are member of a group that may not login on this server.'
-            );
-        }
-        // FIXME: Ensure that the session gets overwritten
-        //$this->assertTrue(empty($session->user_mail));
-    }
 
 }