From: Gunnar Wrobel
Date: Mon, 30 Aug 2010 07:12:59 +0000 (+0200)
Subject: Added the Interfaces package.
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=549a1a57841717f032d1d95e86d10679297356e1;p=horde.git
Added the Interfaces package.
Rationale:
When looking at the Kolab_Session package I realized that
"Horde_Auth::getAuth()" calls have been converted to
"$GLOBALS['registry']->getAuth()". While this may be fine on the
application level I don't think it is acceptable on the level of a
framework package.
"$GLOBALS['registry']->getAuth()" does pretty much the same as
"Horde_Auth::getAuth()" did before and the move of the functionality
into the registry is absolutely fine.
For Kolab_Session this does however mean that the dependency on that
functionality gets further obscured. Something has to setup
$GLOBALS['registry'] before Kolab_Session is called into the mix.
At the same time I think the package would now need to pull in Core as
a dependency which I wouldn't like much either.
I think it is a cleaner solution to provide the Interfaces package. It
can be used to clearly define the communications between Core and the
other framework packages. This also allows to declare the dependencies
in an obvious manner and decouples low level libraries from the BIG
Core thing.
---
diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php
index 86f771b34..16cd295ca 100644
--- a/framework/Core/lib/Horde/Registry.php
+++ b/framework/Core/lib/Horde/Registry.php
@@ -17,6 +17,7 @@
* @package Core
*/
class Horde_Registry
+implements Horde_Interfaces_Registry_Auth
{
/* Session flags. */
const SESSION_NONE = 1;
diff --git a/framework/Core/package.xml b/framework/Core/package.xml
index 88fad1acb..69926c54f 100644
--- a/framework/Core/package.xml
+++ b/framework/Core/package.xml
@@ -286,6 +286,10 @@ Application Framework.
pear.horde.org
+ Interfaces
+ pear.horde.org
+
+
Injector
pear.horde.org
diff --git a/framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php b/framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php
new file mode 100644
index 000000000..7ff0b6289
--- /dev/null
+++ b/framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php
@@ -0,0 +1,47 @@
+
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Interfaces
+ */
+
+/**
+ * Defines a provider of authentication information.
+ *
+ * Copyright 2009-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 Horde
+ * @package Interfaces
+ * @author Gunnar Wrobel
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Interfaces
+ */
+interface Horde_Interfaces_Registry_Auth
+{
+ /**
+ * Returns the currently logged in user, if there is one.
+ *
+ * @param string $format The return format, defaults to the unique Horde
+ * ID. Alternative formats:
+ * - bare: Horde ID without any domain information
+ * (e.g., foo@example.com would be returned as
+ * 'foo').
+ * - domain: Domain of the Horde ID (e.g.,
+ * foo@example.com would be returned as
+ * 'example.com').
+ * - original: The username used to originally login
+ * to Horde.
+ *
+ * @return mixed The user ID or false if no user is logged in.
+ */
+ public function getAuth($format = null);
+}
diff --git a/framework/Interfaces/package.xml b/framework/Interfaces/package.xml
new file mode 100644
index 000000000..7e639ad97
--- /dev/null
+++ b/framework/Interfaces/package.xml
@@ -0,0 +1,72 @@
+
+
+ Interfaces
+ pear.horde.org
+ A collection of Horde specific interfaces.
+ This package provides the interfaces that are required for the communication between framework packages and the core application infrastructure of Horde. The main provider of implementations found in this package will be the Horde Core framework package.
+
+
+ Gunnar Wrobel
+ wrobel
+ p@rdus.de
+ yes
+
+
+ Chuck Hagenbuch
+ chuck
+ chuck@horde.org
+ yes
+
+
+ Jan Schneider
+ jan
+ jan@horde.org
+ yes
+
+ 2009-03-02
+
+ 0.0.1
+ 0.0.1
+
+
+ alpha
+ alpha
+
+ LGPL
+
+ * Initial package.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.3.0
+
+
+ 1.4.0b1
+
+
+
+
+
+
+
+
+
+
+
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session.php b/framework/Kolab_Session/lib/Horde/Kolab/Session.php
index 4a1e778f4..c5b9952af 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session.php
@@ -18,11 +18,9 @@
* 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 Auth::getAuth() respectively
- * Auth::getCredential('password'). Any additional Kolab user data
- * relevant for the user session should be accessed via the Horde_Kolab_Session
- * class.
+ * The users account id needs to be provided from the outside via an instance of
+ * Horde_Interfaces_Registry_Auth::. 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/)
*
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Horde.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Horde.php
deleted file mode 100644
index d9e22c31e..000000000
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Horde.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Kolab_Session
- */
-
-/**
- * Wraps Horde authentication for the Kolab session information.
- *
- * Copyright 2009-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
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Kolab_Session
- */
-class Horde_Kolab_Session_Auth_Horde
-implements Horde_Kolab_Session_Auth_Interface
-{
- /**
- * Get the current user ID.
- *
- * @return string The ID of the current user.
- */
- public function getCurrentUser()
- {
- return $GLOBALS['registry']->getAuth();
- }
-}
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Interface.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Interface.php
deleted file mode 100644
index a85964730..000000000
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Interface.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Kolab_Session
- */
-
-/**
- * Defines an authentication wrapper for the Kolab session information.
- *
- * Copyright 2009-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
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Kolab_Session
- */
-interface Horde_Kolab_Session_Auth_Interface
-{
- /**
- * Get the current user ID.
- *
- * @return string The ID of the current user.
- */
- public function getCurrentUser();
-}
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php
index 379a35ded..861731171 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php
@@ -26,7 +26,7 @@
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
class Horde_Kolab_Session_Auth_Mock
-implements Horde_Kolab_Session_Auth_Interface
+implements Horde_Interfaces_Registry_Auth
{
/**
* The user this instance will report.
@@ -46,12 +46,42 @@ implements Horde_Kolab_Session_Auth_Interface
}
/**
- * Get the current user ID.
+ * Returns the currently logged in user, if there is one.
*
- * @return string The ID of the current user.
+ * @param string $format The return format, defaults to the unique Horde
+ * ID. Alternative formats:
+ * - bare: Horde ID without any domain information
+ * (e.g., foo@example.com would be returned as
+ * 'foo').
+ * - domain: Domain of the Horde ID (e.g.,
+ * foo@example.com would be returned as
+ * 'example.com').
+ * - original: The username used to originally login
+ * to Horde.
+ *
+ * @return mixed The user ID or false if no user is logged in.
*/
- public function getCurrentUser()
+ public function getAuth($format = null)
{
- return $this->_user;
+ if (empty($this->_user)) {
+ return false;
+ }
+
+ $user = $this->_user;
+
+ switch ($format) {
+ case 'bare':
+ return (($pos = strpos($user, '@')) === false)
+ ? $user
+ : substr($user, 0, $pos);
+
+ case 'domain':
+ return (($pos = strpos($user, '@')) === false)
+ ? false
+ : substr($user, $pos + 1);
+
+ default:
+ return $user;
+ }
}
}
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php
index 7f5b67c38..83b17e69a 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Base.php
@@ -14,12 +14,6 @@
/**
* The Horde_Kolab_Session class holds user details in the current session.
*
- * The core user credentials (login, pass) are kept within the Auth module and
- * can be retrieved using Auth::getAuth() respectively
- * Auth::getCredential('password'). 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
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Decorator/Anonymous.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Decorator/Anonymous.php
index a6e39bf54..3f0abbab0 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Decorator/Anonymous.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Decorator/Anonymous.php
@@ -16,12 +16,6 @@
* The Horde_Kolab_Session_Anonymous class allows anonymous access to the Kolab
* system.
*
- * The core user credentials (login, pass) are kept within the Auth module and
- * can be retrieved using Auth::getAuth() respectively
- * Auth::getCredential('password'). Any additional Kolab user data
- * relevant for the user session should be accessed via the Horde_Kolab_Session
- * class.
- *
* Copyright 2009-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Base.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Base.php
index 4b028c10e..c251dca03 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Base.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Base.php
@@ -14,12 +14,6 @@
/**
* A class to check if the given session is valid.
*
- * The core user credentials (login, pass) are kept within the Auth module and
- * can be retrieved using Auth::getAuth() respectively
- * Auth::getCredential('password'). Any additional Kolab user data
- * relevant for the user session should be accessed via the Horde_Kolab_Session
- * class.
- *
* Copyright 2009-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
@@ -44,20 +38,20 @@ implements Horde_Kolab_Session_Valid_Interface
/**
* Provides authentication information for this object.
*
- * @var Horde_Kolab_Session_Auth_Interface
+ * @var Horde_Interfaces_Registry_Auth
*/
private $_auth;
/**
* Constructor.
*
- * @param Horde_Kolab_Session $session The session that should be
- * validated.
- * @param Horde_Kolab_Session_Auth_Interface $auth The authentication handler.
+ * @param Horde_Kolab_Session $session The session that should be
+ * validated.
+ * @param Horde_Interfaces_Registry_Auth $auth The authentication handler.
*/
public function __construct(
Horde_Kolab_Session $session,
- Horde_Kolab_Session_Auth_Interface $auth
+ Horde_Interfaces_Registry_Auth $auth
) {
$this->_session = $session;
$this->_auth = $auth;
@@ -75,7 +69,7 @@ implements Horde_Kolab_Session_Valid_Interface
public function isValid($user = null)
{
$mail = $this->_session->getMail();
- if ($this->_auth->getCurrentUser() != $mail) {
+ if ($this->_auth->getAuth() != $mail) {
return false;
}
if (empty($user)) {
@@ -101,7 +95,7 @@ implements Horde_Kolab_Session_Valid_Interface
/**
* Return the auth driver of this validator.
*
- * @return Horde_Kolab_Session_Auth_Interface The auth driver set for this
+ * @return Horde_Interfaces_Registry_Auth The auth driver set for this
* validator.
*/
public function getAuth()
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Decorator/Logged.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Decorator/Logged.php
index d30be051d..0b5e8f00a 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Decorator/Logged.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Decorator/Logged.php
@@ -76,7 +76,7 @@ implements Horde_Kolab_Session_Valid_Interface
sprintf(
"Invalid Kolab session for current user \"%s\", requested"
. " user \"%s\" and stored user \"%s\".",
- $this->_valid->getAuth()->getCurrentUser(),
+ $this->_valid->getAuth()->getAuth(),
$user,
$this->_valid->getSession()->getMail()
)
@@ -99,7 +99,7 @@ implements Horde_Kolab_Session_Valid_Interface
/**
* Return the auth driver of this validator.
*
- * @return Horde_Kolab_Session_Auth_Interface The auth driver set for this
+ * @return Horde_Interfaces_Registry_Auth The auth driver set for this
* validator.
*/
public function getAuth()
diff --git a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Interface.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Interface.php
index 723875240..0bbd02b03 100644
--- a/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Interface.php
+++ b/framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Interface.php
@@ -14,12 +14,6 @@
/**
* Interface for session validators.
*
- * The core user credentials (login, pass) are kept within the Auth module and
- * can be retrieved using Auth::getAuth() respectively
- * Auth::getCredential('password'). Any additional Kolab user data
- * relevant for the user session should be accessed via the Horde_Kolab_Session
- * class.
- *
* Copyright 2009-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
@@ -55,7 +49,7 @@ interface Horde_Kolab_Session_Valid_Interface
/**
* Return the auth driver of this validator.
*
- * @return Horde_Kolab_Session_Auth_Interface The auth driver set for this
+ * @return Horde_Interfaces_Registry_Auth The auth driver set for this
* validator.
*/
public function getAuth();
diff --git a/framework/Kolab_Session/package.xml b/framework/Kolab_Session/package.xml
index 4c0c306af..1d16375d8 100644
--- a/framework/Kolab_Session/package.xml
+++ b/framework/Kolab_Session/package.xml
@@ -48,8 +48,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
-
@@ -87,7 +85,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
@@ -128,6 +125,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
1.4.0b1
+ Interfaces
+ pear.horde.org
+
+
Kolab_Server
pear.horde.org
@@ -138,14 +139,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Auth
- pear.horde.org
-
-
- Injector
- pear.horde.org
-
-
Log
pear.horde.org
@@ -158,8 +151,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
-
@@ -176,7 +167,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/HordeTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/HordeTest.php
deleted file mode 100644
index 0f6ea9b65..000000000
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/HordeTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- * @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 horde auth driver.
- *
- * Copyright 2009-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
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Kolab_Session
- */
-class Horde_Kolab_Session_Class_Auth_HordeTest extends Horde_Kolab_Session_SessionTestCase
-{
- public function testMethodGetcurrentuserHasResultStringTheCurrentUser()
- {
- $_SESSION['horde_auth']['userId'] = 'test';
- $auth = new Horde_Kolab_Session_Auth_Horde();
- $this->assertEquals('test', $auth->getCurrentUser());
- }
-}
\ No newline at end of file
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/MockTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/MockTest.php
index aefc9b306..31a4f4cb5 100644
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/MockTest.php
+++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/MockTest.php
@@ -35,6 +35,6 @@ class Horde_Kolab_Session_Class_Auth_MockTest extends Horde_Kolab_Session_Sessio
public function testMethodGetcurrentuserHasResultStringTheCurrentUser()
{
$auth = new Horde_Kolab_Session_Auth_Mock('test');
- $this->assertEquals('test', $auth->getCurrentUser());
+ $this->assertEquals('test', $auth->getAuth());
}
}
\ No newline at end of file
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/BaseTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/BaseTest.php
index 910f453ec..61443e765 100644
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/BaseTest.php
+++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/BaseTest.php
@@ -34,9 +34,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
{
public function testMethodIsvalidHasResultBooleanTrueIfTheSessionIsNotConnectedAndTheCurrentUserIsAnonymous()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue(''));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
@@ -48,9 +48,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
public function testMethodIsvalidHasResultBooleanFalseIfTheSessionIsNotConnected()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
@@ -62,9 +62,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserDoesNotMatchTheCurrentUserOfTheSession()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('somebody@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
@@ -76,9 +76,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndNoNewUserWasSet()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
@@ -90,9 +90,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesNeitherTheCurrentUserMailAndUid()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
@@ -104,9 +104,9 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->once())
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/Decorator/LoggedTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/Decorator/LoggedTest.php
index b496fb15b..a7e49d1ea 100644
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/Decorator/LoggedTest.php
+++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/Decorator/LoggedTest.php
@@ -42,9 +42,9 @@ extends Horde_Kolab_Session_SessionTestCase
public function testMethodIsvalidHasPostconditionThatAnInvalidSessionGetsLogged()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->exactly(2))
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('auth@example.org'));
$session = $this->getMock('Horde_Kolab_Session');
$session->expects($this->exactly(2))
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/ValidTest.php b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/ValidTest.php
index 897379236..1cb7e97b0 100644
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/ValidTest.php
+++ b/framework/Kolab_Session/test/Horde/Kolab/Session/Integration/ValidTest.php
@@ -41,9 +41,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanTrueIfTheSessionIsNotConnectedAndTheCurrentUserIsAnonymous()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue(''));
$composite = $this->_getMockedComposite();
$session = new Horde_Kolab_Session_Base(
@@ -55,9 +55,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanFalseIfTheSessionIsNotConnected()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$composite = $this->_getMockedComposite();
$session = new Horde_Kolab_Session_Base(
@@ -69,9 +69,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserDoesNotMatchTheCurrentUserOfTheSession()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('somebody@example.org'));
$this->user->expects($this->exactly(5))
->method('getSingle')
@@ -90,9 +90,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndNoNewUserWasSet()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$this->user->expects($this->exactly(5))
->method('getSingle')
@@ -111,9 +111,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesNeitherTheCurrentUserMailAndUid()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$this->user->expects($this->exactly(5))
->method('getSingle')
@@ -132,9 +132,9 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
{
- $auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$auth->expects($this->once())
- ->method('getCurrentUser')
+ ->method('getAuth')
->will($this->returnValue('mail@example.org'));
$this->user->expects($this->exactly(5))
->method('getSingle')
diff --git a/framework/Kolab_Session/test/Horde/Kolab/Session/SessionTestCase.php b/framework/Kolab_Session/test/Horde/Kolab/Session/SessionTestCase.php
index 444980299..00ebb2c37 100644
--- a/framework/Kolab_Session/test/Horde/Kolab/Session/SessionTestCase.php
+++ b/framework/Kolab_Session/test/Horde/Kolab/Session/SessionTestCase.php
@@ -56,7 +56,7 @@ class Horde_Kolab_Session_SessionTestCase extends PHPUnit_Framework_TestCase
protected function setupFactoryMocks()
{
$this->server = $this->_getMockedComposite();
- $this->session_auth = $this->getMock('Horde_Kolab_Session_Auth_Interface');
+ $this->session_auth = $this->getMock('Horde_Interfaces_Registry_Auth');
$this->session_storage = $this->getMock('Horde_Kolab_Session_Storage_Interface');
}
}
\ No newline at end of file