From e539446c8fdf98482b25574acd4090a47300f877 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Tue, 26 Oct 2010 05:52:01 +0200 Subject: [PATCH] Adapt to the recent Horde_SessionObjects -> Horde_Session modification. --- .../Storage/{Sessionobjects.php => Session.php} | 16 +-- framework/Kolab_Session/package.xml | 122 ++++++++++++--------- .../{SessionobjectsTest.php => SessionTest.php} | 26 ++--- 3 files changed, 89 insertions(+), 75 deletions(-) rename framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/{Sessionobjects.php => Session.php} (75%) rename framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/{SessionobjectsTest.php => SessionTest.php} (57%) diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Sessionobjects.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Session.php similarity index 75% rename from framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Sessionobjects.php rename to framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Session.php index 80b79cf21..cbfb97983 100644 --- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Sessionobjects.php +++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Storage/Session.php @@ -25,24 +25,24 @@ * @license http://www.fsf.org/copyleft/lgpl.html LGPL * @link http://pear.horde.org/index.php?package=Kolab_Session */ -class Horde_Kolab_Session_Storage_Sessionobjects +class Horde_Kolab_Session_Storage_Session implements Horde_Kolab_Session_Storage_Interface { /** * The handler for session objects. * - * @var Horde_SessionObjects + * @var array */ - private $_session_objects; + private $_session; /** * Constructor * - * @param Horde_SessionObjects $session_objects The session objects handler. + * @param array $session The session handler. */ - public function __construct(Horde_SessionObjects $session_objects) + public function __construct($session) { - $this->_session_objects = $session_objects; + $this->_session = $session; } /** @@ -53,7 +53,7 @@ implements Horde_Kolab_Session_Storage_Interface */ public function load() { - return $this->_session_objects->query('kolab_session'); + return $this->_session['kolab_session']; } /** @@ -65,6 +65,6 @@ implements Horde_Kolab_Session_Storage_Interface */ public function save(Horde_Kolab_Session $session) { - $this->_session_objects->overwrite('kolab_session', $session); + $this->_session['kolab_session'] = $session; } } diff --git a/framework/Kolab_Session/package.xml b/framework/Kolab_Session/package.xml index d0c13d6b5..c02fceb36 100644 --- a/framework/Kolab_Session/package.xml +++ b/framework/Kolab_Session/package.xml @@ -1,14 +1,10 @@ - + Kolab_Session pear.horde.org A package managing an active Kolab session. This package handles a Kolab session. It allows to - authenticate against LDAP and provides the users storage locations. - + authenticate against LDAP and provides the users storage locations. Gunnar Wrobel wrobel @@ -27,7 +23,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> jan@horde.org yes - 2010-03-02 + 2010-10-26 + 0.1.0 0.1.0 @@ -38,39 +35,39 @@ http://pear.php.net/dtd/package-2.0.xsd"> LGPL - * Split package from Kolab_Server +* Split package from Kolab_Server - + - - - - + - + - - - + + + - - + + - - + + + + + @@ -78,30 +75,31 @@ http://pear.php.net/dtd/package-2.0.xsd"> - - - + - + - + + + + @@ -136,36 +134,52 @@ http://pear.php.net/dtd/package-2.0.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1.0 + 0.1.0 + + + alpha + alpha + + 2010-10-26 + LGPL + +* Split package from Kolab_Server + + diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionobjectsTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionTest.php similarity index 57% rename from framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionobjectsTest.php rename to framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionTest.php index 92d7dd46e..434d2ce4f 100644 --- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionobjectsTest.php +++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Storage/SessionTest.php @@ -1,6 +1,6 @@ getMock('Horde_SessionObjects', array(), array(), '', false, false); - $session_objects->expects($this->once()) - ->method('query') + $session = $this->getMock('ArrayAccess', array(), array(), '', false, false); + $session->expects($this->once()) + ->method('offsetGet') ->with('kolab_session'); - $storage = new Horde_Kolab_Session_Storage_Sessionobjects($session_objects); + $storage = new Horde_Kolab_Session_Storage_Session($session); $storage->load(); } public function testMethodSaveHasPostconditionThatTheSessionDataWasSaved() { - $session_objects = $this->getMock('Horde_SessionObjects', array(), array(), '', false, false); - $session_objects->expects($this->once()) - ->method('overwrite') + $session = $this->getMock('ArrayAccess', array(), array(), '', false, false); + $session->expects($this->once()) + ->method('offsetSet') ->with('kolab_session', $this->isInstanceOf('Horde_Kolab_Session')); - $session = $this->getMock('Horde_Kolab_Session'); - $storage = new Horde_Kolab_Session_Storage_Sessionobjects($session_objects); - $storage->save($session); + $kolab_session = $this->getMock('Horde_Kolab_Session'); + $storage = new Horde_Kolab_Session_Storage_Session($session); + $storage->save($kolab_session); } } \ No newline at end of file -- 2.11.0