Largely revert 549a1a57841717f032d1d95e86d10679297356e1 - "Added the Interfaces package."
authorGunnar Wrobel <p@rdus.de>
Thu, 23 Sep 2010 19:49:43 +0000 (21:49 +0200)
committerGunnar Wrobel <p@rdus.de>
Thu, 23 Sep 2010 19:49:43 +0000 (21:49 +0200)
This now follows Jan suggestion to simply provide the user name as a string. Much simpler :)

16 files changed:
framework/Core/lib/Horde/Core/Factory/KolabSession.php
framework/Core/lib/Horde/Registry.php
framework/Core/package.xml
framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php [deleted file]
framework/Interfaces/package.xml [deleted file]
framework/Kolab_Session/lib/Horde/Kolab/Session.php
framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php [deleted file]
framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Base.php
framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Decorator/Logged.php
framework/Kolab_Session/lib/Horde/Kolab/Session/Valid/Interface.php
framework/Kolab_Session/package.xml
framework/Kolab_Session/test/Horde/Kolab/Session/Class/Auth/MockTest.php [deleted file]
framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/BaseTest.php
framework/Kolab_Session/test/Horde/Kolab/Session/Class/Valid/Decorator/LoggedTest.php
framework/Kolab_Session/test/Horde/Kolab/Session/Integration/ValidTest.php
framework/Kolab_Session/test/Horde/Kolab/Session/SessionTestCase.php

index d0ed899..a8306e9 100644 (file)
@@ -117,15 +117,16 @@ class Horde_Core_Factory_KolabSession
     /**
      * Return the session validation driver.
      *
-     * @param Horde_Kolab_Session      $session The session to validate.
-     * @param Horde_Kolab_Session_Auth_Interface $auth    The auth handler.
+     * @param Horde_Kolab_Session $session The session to validate.
+     * @param mixed               $auth    The user ID or false if no user is
+     *                                     logged in.
      *
      * @return Horde_Kolab_Session_Valid_Interface The driver for validating
      *                                             sessions.
      */
     public function getSessionValidator(
         Horde_Kolab_Session $session,
-        Horde_Kolab_Session_Auth_Interface $auth
+        $auth
     ) {
         $configuration = $this->_injector->getInstance('Horde_Kolab_Session_Configuration');
 
@@ -154,7 +155,7 @@ class Horde_Core_Factory_KolabSession
     ) {
         return $this->getSessionValidator(
             $session,
-            $this->_injector->getInstance('Horde_Kolab_Session_Auth_Interface')
+            $this->_injector->getInstance('Horde_Registry')->getAuth()
         )->isValid();
     }
 
index 2cb25e5..c41ef86 100644 (file)
@@ -17,7 +17,6 @@
  * @package  Core
  */
 class Horde_Registry
-implements Horde_Interfaces_Registry_Auth
 {
     /* Session flags. */
     const SESSION_NONE = 1;
index 20ba995..b757f25 100644 (file)
@@ -307,10 +307,6 @@ Application Framework.</description>
     <channel>pear.horde.org</channel>
    </package>
    <package>
-    <name>Interfaces</name>
-    <channel>pear.horde.org</channel>
-   </package>
-   <package>
     <name>Injector</name>
     <channel>pear.horde.org</channel>
    </package>
diff --git a/framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php b/framework/Interfaces/lib/Horde/Interfaces/Registry/Auth.php
deleted file mode 100644 (file)
index 7ff0b62..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Defines a provider of authentication information.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Interfaces
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @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 <wrobel@pardus.de>
- * @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
deleted file mode 100644 (file)
index 7e639ad..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>Interfaces</name>
- <channel>pear.horde.org</channel>
- <summary>A collection of Horde specific interfaces.</summary>
- <description>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.
- </description>
- <lead>
-  <name>Gunnar Wrobel</name>
-  <user>wrobel</user>
-  <email>p@rdus.de</email>
-  <active>yes</active>
- </lead>
- <lead>
-  <name>Chuck Hagenbuch</name>
-  <user>chuck</user>
-  <email>chuck@horde.org</email>
-  <active>yes</active>
- </lead>
- <lead>
-  <name>Jan Schneider</name>
-  <user>jan</user>
-  <email>jan@horde.org</email>
-  <active>yes</active>
- </lead>
- <date>2009-03-02</date>
- <version>
-  <release>0.0.1</release>
-  <api>0.0.1</api>
- </version>
- <stability>
-  <release>alpha</release>
-  <api>alpha</api>
- </stability>
- <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>
-  * Initial package.
- </notes>
- <contents>
-  <dir name="/">
-   <dir name="lib">
-    <dir name="Horde">
-     <dir name="Interfaces">
-      <dir name="Registry">
-       <file name="Auth.php" role="php" />
-      </dir> <!-- /lib/Horde/Session -->
-     </dir> <!-- /lib/Horde/Kolab -->
-    </dir> <!-- /lib/Horde -->
-   </dir> <!-- /lib -->
-  </dir> <!-- / -->
- </contents>
- <dependencies>
-  <required>
-   <php>
-    <min>4.3.0</min>
-   </php>
-   <pearinstaller>
-    <min>1.4.0b1</min>
-   </pearinstaller>
-  </required>
- </dependencies>
- <phprelease>
-  <filelist>
-   <install name="lib/Horde/Interfaces/Registry/Auth.php" as="Horde/Interfaces/Registry/Auth.php" />
-  </filelist>
- </phprelease>
- <changelog>
- </changelog>
-</package>
index c5b9952..70c3f9c 100644 (file)
@@ -18,9 +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 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.
+ * The users account id needs to be provided from the outside. 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/Mock.php b/framework/Kolab_Session/lib/Horde/Kolab/Session/Auth/Mock.php
deleted file mode 100644 (file)
index 8617311..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/**
- * Mock authentication for the Kolab session information.
- *
- * 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
- */
-
-/**
- * Mock 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 <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Session
- */
-class Horde_Kolab_Session_Auth_Mock
-implements Horde_Interfaces_Registry_Auth
-{
-    /**
-     * The user this instance will report.
-     *
-     * @var string
-     */
-    private $_user;
-
-    /**
-     * Constructor
-     *
-     * @param string $user The user this instance should report.
-     */
-    public function __construct($user)
-    {
-        $this->_user = $user;
-    }
-
-    /**
-     * 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)
-    {
-        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;
-        }
-    }
-}
index c251dca..10feaa0 100644 (file)
@@ -38,20 +38,20 @@ implements Horde_Kolab_Session_Valid_Interface
     /**
      * Provides authentication information for this object.
      *
-     * @var Horde_Interfaces_Registry_Auth
+     * @var mixed The user ID or false if no user is logged in.
      */
     private $_auth;
 
     /**
      * Constructor.
      *
-     * @param Horde_Kolab_Session            $session The session that should be
-     *                                                validated.
-     * @param Horde_Interfaces_Registry_Auth $auth    The authentication handler.
+     * @param Horde_Kolab_Session $session The session that should be validated.
+     * @param mixed               $auth    The user ID or false if no user is
+     *                                     logged in.
      */
     public function __construct(
         Horde_Kolab_Session $session,
-        Horde_Interfaces_Registry_Auth $auth
+        $auth
     ) {
         $this->_session = $session;
         $this->_auth    = $auth;
@@ -69,7 +69,7 @@ implements Horde_Kolab_Session_Valid_Interface
     public function isValid($user = null)
     {
         $mail = $this->_session->getMail();
-        if ($this->_auth->getAuth() != $mail) {
+        if ($this->_auth != $mail) {
             return false;
         }
         if (empty($user)) {
@@ -95,8 +95,7 @@ implements Horde_Kolab_Session_Valid_Interface
     /**
      * Return the auth driver of this validator.
      *
-     * @return Horde_Interfaces_Registry_Auth The auth driver set for this
-     * validator.
+     * @return mixed The user ID or false if no user is logged in.
      */
     public function getAuth()
     {
index 0b5e8f0..08a1971 100644 (file)
@@ -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()->getAuth(),
+                    $this->_valid->getAuth(),
                     $user,
                     $this->_valid->getSession()->getMail()
                 )
@@ -99,8 +99,7 @@ implements Horde_Kolab_Session_Valid_Interface
     /**
      * Return the auth driver of this validator.
      *
-     * @return Horde_Interfaces_Registry_Auth The auth driver set for this
-     * validator.
+     * @return mixed The user ID or false if no user is logged in.
      */
     public function getAuth()
     {
index 0bbd02b..8c2d6d7 100644 (file)
@@ -49,8 +49,7 @@ interface Horde_Kolab_Session_Valid_Interface
     /**
      * Return the auth driver of this validator.
      *
-     * @return Horde_Interfaces_Registry_Auth The auth driver set for this
-     * validator.
+     * @return mixed The user ID or false if no user is logged in.
      */
     public function getAuth();
 }
\ No newline at end of file
index 3c9c258..2af0166 100644 (file)
@@ -47,9 +47,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
      <dir name="Kolab">
       <file name="Session.php" role="php" />
       <dir name="Session">
-       <dir name="Auth">
-        <file name="Mock.php" role="php" />
-       </dir> <!-- /lib/Horde/Session/Auth -->
        <file name="Base.php" role="php" />
        <dir name="Decorator">
         <file name="Anonymous.php" role="php" />
@@ -84,9 +81,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
        <file name="AllTests.php" role="test" />
        <file name="Autoload.php" role="test" />
        <dir name="Class">
-        <dir name="Auth">
-         <file name="MockTest.php" role="test" />
-        </dir> <!-- /test/Horde/Kolab/Session/Class/Auth -->
         <file name="BaseTest.php" role="test" />
         <dir name="Decorator">
          <file name="AnonymousTest.php" role="test" />
@@ -125,10 +119,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <min>1.4.0b1</min>
    </pearinstaller>
    <package>
-    <name>Interfaces</name>
-    <channel>pear.horde.org</channel>
-   </package>
-   <package>
     <name>Kolab_Server</name>
     <channel>pear.horde.org</channel>
    </package>
@@ -151,7 +141,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
  <phprelease>
   <filelist>
    <install name="lib/Horde/Kolab/Session.php" as="Horde/Kolab/Session.php" />
-   <install name="lib/Horde/Kolab/Session/Auth/Mock.php" as="Horde/Kolab/Session/Auth/Mock.php" />
    <install name="lib/Horde/Kolab/Session/Base.php" as="Horde/Kolab/Session/Base.php" />
    <install name="lib/Horde/Kolab/Session/Exception.php" as="Horde/Kolab/Session/Exception.php" />
    <install name="lib/Horde/Kolab/Session/Exception/Badlogin.php" as="Horde/Kolab/Session/Exception/Badlogin.php" />
@@ -167,7 +156,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <install name="lib/Horde/Kolab/Session/Valid/Interface.php" as="Horde/Kolab/Session/Valid/Interface.php" />
    <install name="test/Horde/Kolab/Session/AllTests.php" as="Horde/Kolab/Session/AllTests.php" />
    <install name="test/Horde/Kolab/Session/Autoload.php" as="Horde/Kolab/Session/Autoload.php" />
-   <install name="test/Horde/Kolab/Session/Class/Auth/MockTest.php" as="Horde/Kolab/Session/Class/Auth/MockTest.php" />
    <install name="test/Horde/Kolab/Session/Class/BaseTest.php" as="Horde/Kolab/Session/Class/BaseTest.php" />
    <install name="test/Horde/Kolab/Session/Class/Decorator/AnonymousTest.php" as="Horde/Kolab/Session/Class/Decorator/AnonymousTest.php" />
    <install name="test/Horde/Kolab/Session/Class/Decorator/LoggedTest.php" as="Horde/Kolab/Session/Class/Decorator/LoggedTest.php" />
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
deleted file mode 100644 (file)
index 31a4f4c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Test the mock auth driver.
- *
- * 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
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../../Autoload.php';
-
-/**
- * Test the mock 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 <wrobel@pardus.de>
- * @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_MockTest extends Horde_Kolab_Session_SessionTestCase
-{
-    public function testMethodGetcurrentuserHasResultStringTheCurrentUser()
-    {
-        $auth = new Horde_Kolab_Session_Auth_Mock('test');
-        $this->assertEquals('test', $auth->getAuth());
-    }
-}
\ No newline at end of file
index 61443e7..33851f9 100644 (file)
@@ -34,10 +34,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 {
     public function testMethodIsvalidHasResultBooleanTrueIfTheSessionIsNotConnectedAndTheCurrentUserIsAnonymous()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue(''));
+        $auth = false;
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
@@ -48,10 +45,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheSessionIsNotConnected()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
@@ -62,10 +56,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserDoesNotMatchTheCurrentUserOfTheSession()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('somebody@example.org'));
+        $auth = 'somebody@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
@@ -76,10 +67,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 
     public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndNoNewUserWasSet()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
@@ -90,10 +78,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesNeitherTheCurrentUserMailAndUid()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
@@ -104,10 +89,7 @@ class Horde_Kolab_Session_Class_Valid_BaseTest extends Horde_Kolab_Session_Sessi
 
     public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->once())
             ->method('getMail')
index a7e49d1..931e79b 100644 (file)
@@ -42,10 +42,7 @@ extends Horde_Kolab_Session_SessionTestCase
 
     public function testMethodIsvalidHasPostconditionThatAnInvalidSessionGetsLogged()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->exactly(2))
-            ->method('getAuth')
-            ->will($this->returnValue('auth@example.org'));
+        $auth = 'auth@example.org';
         $session = $this->getMock('Horde_Kolab_Session');
         $session->expects($this->exactly(2))
             ->method('getMail')
index 1cb7e97..0fcbedf 100644 (file)
@@ -41,10 +41,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanTrueIfTheSessionIsNotConnectedAndTheCurrentUserIsAnonymous()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue(''));
+        $auth = false;
         $composite = $this->_getMockedComposite();
         $session = new Horde_Kolab_Session_Base(
             $composite, array()
@@ -55,10 +52,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheSessionIsNotConnected()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $composite = $this->_getMockedComposite();
         $session = new Horde_Kolab_Session_Base(
             $composite, array()
@@ -69,10 +63,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserDoesNotMatchTheCurrentUserOfTheSession()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('somebody@example.org'));
+        $auth = 'somebody@example.org';
         $this->user->expects($this->exactly(5))
             ->method('getSingle')
             ->will($this->returnValue('mail@example.org'));
@@ -90,10 +81,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndNoNewUserWasSet()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $this->user->expects($this->exactly(5))
             ->method('getSingle')
             ->will($this->returnValue('mail@example.org'));
@@ -111,10 +99,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanFalseIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesNeitherTheCurrentUserMailAndUid()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $this->user->expects($this->exactly(5))
             ->method('getSingle')
             ->will($this->returnValue('mail@example.org'));
@@ -132,10 +117,7 @@ class Horde_Kolab_Session_Integration_ValidTest extends Horde_Kolab_Session_Sess
 
     public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
     {
-        $auth = $this->getMock('Horde_Interfaces_Registry_Auth');
-        $auth->expects($this->once())
-            ->method('getAuth')
-            ->will($this->returnValue('mail@example.org'));
+        $auth = 'mail@example.org';
         $this->user->expects($this->exactly(5))
             ->method('getSingle')
             ->will($this->returnValue('mail@example.org'));
index 00ebb2c..4449802 100644 (file)
@@ -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_Interfaces_Registry_Auth');
+        $this->session_auth    = $this->getMock('Horde_Kolab_Session_Auth_Interface');
         $this->session_storage = $this->getMock('Horde_Kolab_Session_Storage_Interface');
     }
 }
\ No newline at end of file