From 6dd78771df48f40f6c18df42a826080f60a90b39 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Wed, 17 Mar 2010 08:51:30 +0100 Subject: [PATCH] This needs to be tested and implemented in the Auth module. --- .../test/Horde/Auth/Kolab/Integration/AuthTest.php | 94 +++++++++++++++++++ .../Kolab/Session/Integration/SessionTest.php | 103 --------------------- 2 files changed, 94 insertions(+), 103 deletions(-) diff --git a/framework/Auth/test/Horde/Auth/Kolab/Integration/AuthTest.php b/framework/Auth/test/Horde/Auth/Kolab/Integration/AuthTest.php index 73a305f7a..9202d711b 100644 --- a/framework/Auth/test/Horde/Auth/Kolab/Integration/AuthTest.php +++ b/framework/Auth/test/Horde/Auth/Kolab/Integration/AuthTest.php @@ -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 diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SessionTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SessionTest.php index e4685c575..66ec59e4c 100644 --- a/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SessionTest.php +++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/SessionTest.php @@ -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)); - } } -- 2.11.0