Class Horde_Test_Stub_Registry
A test replacement for Horde_Registry.
Copyright 2011-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
|
#
__construct( string $user, string $app )
Constructor.
Parameters
- $user
- The current user.
- $app
- The current application.
|
public
mixed
|
#
getAuth( string $format = null )
Returns the currently logged in user, if there is one.
Returns the currently logged in user, if there is one.
Parameters
- $format
- <p>The return format, defaults to the unique Horde
ID. Alternative formats:</p>
<pre>bare - Horde ID without any domain information.
EXAMPLE: foo@example.com would be returned <span class="php-keyword1">as</span> <span class="php-quote">'foo'</span>.
domain: Domain of the Horde ID.
EXAMPLE: foo@example.com would be returned <span class="php-keyword1">as</span> <span class="php-quote">'example.com'</span>.
original: The username used to originally login to Horde.</pre>
Returns
mixed The user ID or false if no user is logged in.
|
public
boolean
|
#
isAdmin( array $options = array() )
Is a user an administrator?
Is a user an administrator?
Parameters
- $options
- Options:
<pre><span class="php-quote">'permission'</span> - (string) Allow users with this permission admin access
in the <span class="php-keyword2">current</span> context.
<span class="php-quote">'permlevel'</span> - (integer) The level of permissions to check <span class="php-keyword1">for</span>.
Defaults to Horde_Perms::EDIT.
<span class="php-quote">'user'</span> - (string) The user to check.
Defaults to self::getAuth().</pre>
Returns
boolean Whether or not this is an admin user.
|
public
string
|
#
get( string $parameter, string $app = null )
Return the requested configuration parameter for the specified
application. If no application is specified, the value of
the current application is used. However, if the parameter is not
present for that application, the Horde-wide value is used instead.
If that is not present, we return null.
Return the requested configuration parameter for the specified
application. If no application is specified, the value of
the current application is used. However, if the parameter is not
present for that application, the Horde-wide value is used instead.
If that is not present, we return null.
Parameters
- $parameter
- The configuration value to retrieve.
- $app
- The application to get the value for.
Returns
string The requested parameter, or null if it is not set.
|
public
string
|
#
getApp( )
Return the current application - the app at the top of the application
stack.
Return the current application - the app at the top of the application
stack.
Returns
string The current application.
|
public
mixed
|
#
hasInterface( string $interface )
Determine if an interface is implemented by an active application.
Determine if an interface is implemented by an active application.
Parameters
- $interface
- The interface to check for.
Returns
mixed The application implementing $interface if we have it,
false if the interface is not implemented.
|
public
array
|
#
listAPIs( )
Returns all available registry APIs.
Returns all available registry APIs.
Returns
array The API list.
|