/**
* The session handler.
*
- * @var Horde_Kolab_Session_Interface
+ * @var Horde_Kolab_Session
*/
private $_session;
/**
* Set the session handler.
*
- * @param Horde_Kolab_Session_Interface $session The session handler.
+ * @param Horde_Kolab_Session $session The session handler.
*
* @return NULL
*/
- public function setSession(Horde_Kolab_Session_Interface $session)
+ public function setSession(Horde_Kolab_Session $session)
{
$this->_session = $session;
}
/**
* Retrieve a connected kolab session.
*
- * @return Horde_Kolab_Session_Interface The connected session.
+ * @return Horde_Kolab_Session The connected session.
*
* @throws Horde_Kolab_Session_Exception
*/
{
public function setUp()
{
- $this->session = $this->getMock('Horde_Kolab_Session_Interface');
+ $this->session = $this->getMock('Horde_Kolab_Session');
$this->factory = $this->getMock('Horde_Kolab_Session_Factory_Interface');
if (!defined('HORDE_BASE')) {
$auth = new Horde_Auth_Kolab();
$auth->setSession($this->session);
$this->assertType(
- 'Horde_Kolab_Session_Interface',
+ 'Horde_Kolab_Session',
$auth->getSession('user', array('password' => 'test'))
);
}
->with('user', array('password' => 'test'))
->will($this->returnValue($this->session));
$this->assertType(
- 'Horde_Kolab_Session_Interface',
+ 'Horde_Kolab_Session',
$auth->getSession('user', array('password' => 'test'))
);
}
/**
* Return the session validation driver.
*
- * @param Horde_Kolab_Session_Interface $session The session to validate.
+ * @param Horde_Kolab_Session $session The session to validate.
* @param Horde_Kolab_Session_Auth_Interface $auth The auth handler.
*
* @return Horde_Kolab_Session_Valid_Interface The driver for validating
* sessions.
*/
public function getSessionValidator(
- Horde_Kolab_Session_Interface $session,
+ Horde_Kolab_Session $session,
Horde_Kolab_Session_Auth_Interface $auth
) {
$configuration = $this->_injector->getInstance('Horde_Kolab_Session_Configuration');
/**
* Validate the given session.
*
- * @param Horde_Kolab_Session_Interface $session The session to validate.
+ * @param Horde_Kolab_Session $session The session to validate.
*
* @return boolean True if the given session is valid.
*/
public function validate(
- Horde_Kolab_Session_Interface $session
+ Horde_Kolab_Session $session
) {
return $this->getSessionValidator(
$session,
public function testMethodGetvalidatorHasResultHordekolabsessionvalid()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$this->assertType(
'Horde_Kolab_Session_Valid_Interface',
$this->_getFactory()->getSessionValidator($session, $this->session_auth)
$this->session_auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
public function testMethodGetsessionHasResultHordekolabsessionTheOldSessionIfAnOldSessionWasStoredAndValid()
{
$factory = $this->_getFactory();
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
public function testMethodGetsessionHasResultHordekolabsessionANewSessionIfAnOldSessionWasStoredAndInvalid()
{
$factory = $this->_getFactory();
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
$this->session_storage->expects($this->once())
->method('load')
->will($this->returnValue(false));
- $this->assertType('Horde_Kolab_Session_Interface', $factory->getSession());
+ $this->assertType('Horde_Kolab_Session', $factory->getSession());
}
public function testMethodGetsessionvalidatorHasResultHordekolabsessionvalidloggedIfConfiguredThatWay()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
$GLOBALS['conf']['kolab']['session']['log'] = true;
$this->assertType(
--- /dev/null
+<?php
+/**
+ * The interface describing Horde_Kolab_Session handlers.
+ *
+ * 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
+ */
+
+/**
+ * The interface describing Horde_Kolab_Session handlers.
+ *
+ * Horde_Kolab_Server currently has no caching so we mainly cache some core user
+ * information in the Kolab session handler as reading this data is expensive
+ * and it is sufficient to read it once per session.
+ *
+ * The core user credentials (login, pass) are kept within the Auth module and
+ * can be retrieved using <code>Auth::getAuth()</code> respectively
+ * <code>Auth::getCredential('password')</code>. Any additional Kolab user data
+ * relevant for the user session should be accessed via the Horde_Kolab_Session
+ * class.
+ *
+ * Copyright 2008-2010 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
+ */
+interface Horde_Kolab_Session
+{
+ /**
+ * Try to connect the session handler.
+ *
+ * @param string $user_id The user ID to connect with.
+ * @param array $credentials An array of login credentials. For Kolab,
+ * this must contain a "password" entry.
+ *
+ * @return NULL
+ *
+ * @throws Horde_Kolab_Session_Exception If the connection failed.
+ */
+ public function connect($user_id = null, array $credentials = null);
+
+ /**
+ * Return the user id used for connecting the session.
+ *
+ * @return string The user id.
+ */
+ public function getId();
+
+ /**
+ * Set the user id used for connecting the session.
+ *
+ * @param string $id The user id.
+ *
+ * @return NULL
+ */
+ public function setId($id);
+
+ /**
+ * Return the users mail address.
+ *
+ * @return string The users mail address.
+ */
+ public function getMail();
+
+ /**
+ * Return the users uid.
+ *
+ * @return string The users uid.
+ */
+ public function getUid();
+
+ /**
+ * Return the users name.
+ *
+ * @return string The users name.
+ */
+ public function getName();
+
+ /**
+ * Return the imap server.
+ *
+ * @return string The imap host for the current user.
+ */
+ public function getImapServer();
+
+ /**
+ * Return the freebusy server.
+ *
+ * @return string The freebusy host for the current user.
+ */
+ public function getFreebusyServer();
+
+ /**
+ * Return a connection to the Kolab storage system.
+ *
+ * @return Horde_Kolab_Storage The storage connection.
+ */
+ public function getStorage();
+}
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
-class Horde_Kolab_Session_Base implements Horde_Kolab_Session_Interface
+class Horde_Kolab_Session_Base implements Horde_Kolab_Session
{
/**
* Kolab configuration parameters.
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
class Horde_Kolab_Session_Decorator_Anonymous
-implements Horde_Kolab_Session_Interface
+implements Horde_Kolab_Session
{
/**
* The session handler this instance provides with anonymous access.
*
- * @var Horde_Kolab_Session_Interface
+ * @var Horde_Kolab_Session
*/
private $_session;
/**
* Constructor.
*
- * @param Horde_Kolab_Session_Interface $session The this instance should provide
- * anonymous access for.
- * @param string $user ID of the anonymous user.
- * @param string $pass Password of the anonymous user.
+ * @param Horde_Kolab_Session $session The this instance should provide
+ * anonymous access for.
+ * @param string $user ID of the anonymous user.
+ * @param string $pass Password of the anonymous user.
*/
public function __construct(
- Horde_Kolab_Session_Interface $session,
+ Horde_Kolab_Session $session,
$user,
$pass
) {
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
class Horde_Kolab_Session_Decorator_Logged
-implements Horde_Kolab_Session_Interface
+implements Horde_Kolab_Session
{
/**
* The session handler.
*
- * @var Horde_Kolab_Session_Interface
+ * @var Horde_Kolab_Session
*/
private $_session;
* The provided logger class needs to implement the methods info() and
* err().
*
- * @param Horde_Kolab_Session_Interface $session The session handler.
- * @param mixed $logger The logger instance.
+ * @param Horde_Kolab_Session $session The session handler.
+ * @param mixed $logger The logger instance.
*/
public function __construct(
- Horde_Kolab_Session_Interface $session,
+ Horde_Kolab_Session $session,
$logger
) {
$this->_session = $session;
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
class Horde_Kolab_Session_Decorator_Stored
-implements Horde_Kolab_Session_Interface
+implements Horde_Kolab_Session
{
/**
* The session handler.
*
- * @var Horde_Kolab_Session_Interface
+ * @var Horde_Kolab_Session
*/
private $_session;
/**
* Constructor.
*
- * @param Horde_Kolab_Session_Interface $session The session handler.
- * @param Horde_Kolab_Session_Storage $storage Store the session here.
+ * @param Horde_Kolab_Session $session The session handler.
+ * @param Horde_Kolab_Session_Storage $storage Store the session here.
*/
public function __construct(
- Horde_Kolab_Session_Interface $session,
+ Horde_Kolab_Session $session,
Horde_Kolab_Session_Storage_Interface $storage
) {
$this->_session = $session;
+++ /dev/null
-<?php
-/**
- * The interface describing Horde_Kolab_Session handlers.
- *
- * 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
- */
-
-/**
- * The interface describing Horde_Kolab_Session handlers.
- *
- * Horde_Kolab_Server currently has no caching so we mainly cache some core user
- * information in the Kolab session handler as reading this data is expensive
- * and it is sufficient to read it once per session.
- *
- * The core user credentials (login, pass) are kept within the Auth module and
- * can be retrieved using <code>Auth::getAuth()</code> respectively
- * <code>Auth::getCredential('password')</code>. Any additional Kolab user data
- * relevant for the user session should be accessed via the Horde_Kolab_Session
- * class.
- *
- * Copyright 2008-2010 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
- */
-interface Horde_Kolab_Session_Interface
-{
- /**
- * Try to connect the session handler.
- *
- * @param string $user_id The user ID to connect with.
- * @param array $credentials An array of login credentials. For Kolab,
- * this must contain a "password" entry.
- *
- * @return NULL
- *
- * @throws Horde_Kolab_Session_Exception If the connection failed.
- */
- public function connect($user_id = null, array $credentials = null);
-
- /**
- * Return the user id used for connecting the session.
- *
- * @return string The user id.
- */
- public function getId();
-
- /**
- * Set the user id used for connecting the session.
- *
- * @param string $id The user id.
- *
- * @return NULL
- */
- public function setId($id);
-
- /**
- * Return the users mail address.
- *
- * @return string The users mail address.
- */
- public function getMail();
-
- /**
- * Return the users uid.
- *
- * @return string The users uid.
- */
- public function getUid();
-
- /**
- * Return the users name.
- *
- * @return string The users name.
- */
- public function getName();
-
- /**
- * Return the imap server.
- *
- * @return string The imap host for the current user.
- */
- public function getImapServer();
-
- /**
- * Return the freebusy server.
- *
- * @return string The freebusy host for the current user.
- */
- public function getFreebusyServer();
-
- /**
- * Return a connection to the Kolab storage system.
- *
- * @return Horde_Kolab_Storage The storage connection.
- */
- public function getStorage();
-}
*
* @return NULL
*/
- public function save(Horde_Kolab_Session_Interface $session);
+ public function save(Horde_Kolab_Session $session);
}
/**
* Save the session information.
*
- * @param Horde_Kolab_Session_Interface $session The session information.
+ * @param Horde_Kolab_Session $session The session information.
*
* @return NULL
*/
- public function save(Horde_Kolab_Session_Interface $session)
+ public function save(Horde_Kolab_Session $session)
{
$this->session = $session;
}
/**
* Save the session information.
*
- * @param Horde_Kolab_Session_Interface $session The session information.
+ * @param Horde_Kolab_Session $session The session information.
*
* @return NULL
*/
- public function save(Horde_Kolab_Session_Interface $session)
+ public function save(Horde_Kolab_Session $session)
{
$this->_session_objects->overwrite('kolab_session', $session);
}
/**
* The session handler this instance provides with anonymous access.
*
- * @var Horde_Kolab_Session_Interface
+ * @var Horde_Kolab_Session
*/
private $_session;
/**
* Constructor.
*
- * @param Horde_Kolab_Session_Interface $session The session that should be
- * validated.
+ * @param Horde_Kolab_Session $session The session that should be
+ * validated.
* @param Horde_Kolab_Session_Auth_Interface $auth The authentication handler.
*/
public function __construct(
- Horde_Kolab_Session_Interface $session,
+ Horde_Kolab_Session $session,
Horde_Kolab_Session_Auth_Interface $auth
) {
$this->_session = $session;
/**
* Return the session this validator checks.
*
- * @return Horde_Kolab_Session_Interface The session checked by this
+ * @return Horde_Kolab_Session The session checked by this
* validator.
*/
public function getSession()
/**
* Return the session this validator checks.
*
- * @return Horde_Kolab_Session_Interface The session checked by this
+ * @return Horde_Kolab_Session The session checked by this
* validator.
*/
public function getSession()
/**
* Return the session this validator checks.
*
- * @return Horde_Kolab_Session_Interface The session checked by this
+ * @return Horde_Kolab_Session The session checked by this
* validator.
*/
public function getSession();
<dir name="lib">
<dir name="Horde">
<dir name="Kolab">
+ <file name="Session.php" role="php" />
<dir name="Session">
<dir name="Auth">
<file name="Horde.php" role="php" />
<dir name="Exception">
<file name="Badlogin.php" role="php" />
</dir> <!-- /lib/Horde/Session/Exception -->
- <file name="Interface.php" role="php" />
<file name="Singleton.php" role="php" />
<dir name="Storage">
<file name="Mock.php" role="php" />
</dependencies>
<phprelease>
<filelist>
+ <install name="lib/Horde/Kolab/Session.php" as="Horde/Kolab/Session.php" />
<install name="lib/Horde/Kolab/Session/Auth/Horde.php" as="Horde/Kolab/Session/Auth/Horde.php" />
<install name="lib/Horde/Kolab/Session/Auth/Interface.php" as="Horde/Kolab/Session/Auth/Interface.php" />
<install name="lib/Horde/Kolab/Session/Auth/Mock.php" as="Horde/Kolab/Session/Auth/Mock.php" />
<install name="lib/Horde/Kolab/Session/Decorator/Anonymous.php" as="Horde/Kolab/Session/Decorator/Anonymous.php" />
<install name="lib/Horde/Kolab/Session/Decorator/Logged.php" as="Horde/Kolab/Session/Decorator/Logged.php" />
<install name="lib/Horde/Kolab/Session/Decorator/Stored.php" as="Horde/Kolab/Session/Decorator/Stored.php" />
- <install name="lib/Horde/Kolab/Session/Interface.php" as="Horde/Kolab/Session/Interface.php" />
<install name="lib/Horde/Kolab/Session/Singleton.php" as="Horde/Kolab/Session/Singleton.php" />
<install name="lib/Horde/Kolab/Session/Storage/Interface.php" as="Horde/Kolab/Session/Storage/Interface.php" />
<install name="lib/Horde/Kolab/Session/Storage/Mock.php" as="Horde/Kolab/Session/Storage/Mock.php" />
{
public function testMethodConnectHasPostconditionThatTheConnectionHasBeenEstablishedAsAnonymousUserIfRequired()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->with('anonymous', array('password' => 'pass'));
public function testMethodGetidReturnsNullIfConnectedUserIsAnonymousUser()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getId')
->will($this->returnValue('anonymous'));
public function testMethodConnectGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->with(array('password' => 'pass'));
public function testMethodGetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getId')
->will($this->returnValue('1'));
public function testMethodSetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('setId')
->with('1');
public function testMethodGetmailGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('1'));
public function testMethodGetuidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getUid')
->will($this->returnValue('1'));
public function testMethodGetnameGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getName')
->will($this->returnValue('1'));
public function testMethodGetimapserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getImapServer')
->will($this->returnValue('1'));
public function testMethodGetfreebusyserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getFreebusyServer')
->will($this->returnValue('1'));
public function testMethodGetstorageGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getStorage')
->will($this->returnValue('1'));
public function testMethodConnectHasPostconditionThatASuccessfulConnectionGetsLogged()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->with(array('password' => 'pass'));
public function testMethodConnectHasPostconditionThatAnUnsuccessfulConnectionGetsLogged()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->will($this->throwException(new Horde_Kolab_Session_Exception('Error.')));
public function testMethodConnectGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->with(array('password' => 'pass'));
public function testMethodGetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getId')
->will($this->returnValue('1'));
public function testMethodSetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('setId')
->with('1');
public function testMethodGetmailGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('1'));
public function testMethodGetuidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getUid')
->will($this->returnValue('1'));
public function testMethodGetnameGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getName')
->will($this->returnValue('1'));
public function testMethodGetimapserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getImapServer')
->will($this->returnValue('1'));
public function testMethodGetfreebusyserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getFreebusyServer')
->will($this->returnValue('1'));
public function testMethodGetstorageGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getStorage')
->will($this->returnValue('1'));
{
$this->storage->expects($this->once())
->method('save')
- ->with($this->isInstanceOf('Horde_Kolab_Session_Interface'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ ->with($this->isInstanceOf('Horde_Kolab_Session'));
+ $session = $this->getMock('Horde_Kolab_Session');
$stored = new Horde_Kolab_Session_Decorator_Stored($session, $this->storage);
$stored = null;
}
public function testMethodConnectGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('connect')
->with(array('password' => 'pass'));
public function testMethodGetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getId')
->will($this->returnValue('1'));
public function testMethodSetidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('setId')
->with('1');
public function testMethodGetmailGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('1'));
public function testMethodGetuidGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getUid')
->will($this->returnValue('1'));
public function testMethodGetnameGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getName')
->will($this->returnValue('1'));
public function testMethodGetimapserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getImapServer')
->will($this->returnValue('1'));
public function testMethodGetfreebusyserverGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getFreebusyServer')
->will($this->returnValue('1'));
public function testMethodGetstorageGetsDelegated()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getStorage')
->will($this->returnValue('1'));
public function testMethodSaveHasPostconditionThatTheSessionDataWasSaved()
{
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$storage = new Horde_Kolab_Session_Storage_Mock('test');
$storage->save($session);
$this->assertSame($session, $storage->session);
$session_objects = $this->getMock('Horde_SessionObjects', array(), array(), '', false, false);
$session_objects->expects($this->once())
->method('overwrite')
- ->with('kolab_session', $this->isInstanceOf('Horde_Kolab_Session_Interface'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ ->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);
}
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue(''));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue(''));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue(''));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('somebody@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
->method('getMail')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->exactly(2))
->method('getCurrentUser')
->will($this->returnValue('auth@example.org'));
- $session = $this->getMock('Horde_Kolab_Session_Interface');
+ $session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->exactly(2))
->method('getMail')
->will($this->returnValue('somebody@example.org'));