Class Horde_Test_Setup
A test helper for generating complex test setups.
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
|
|
public
null
|
#
setup( array $params )
Add a new set of elements to the service container.
Add a new set of elements to the service container.
Parameters
- $params
- <p>All parameters necessary for creating the services.
The keys of the array elements define the name that
will be used for registering the test service with
the injector. The element values are a
configuration array with the following elements:</p>
<pre><span class="php-quote">'factory'</span> - (string) Name of the factory. Can be a full <span class="php-keyword1">class</span> name <span class="php-keyword1">or</span> an
abbreviated name that will get prepended with
<span class="php-quote">'Horde_Test_Factory_'</span>
<span class="php-quote">'method'</span> - (string) Method name that will be invoked on the above factory
to generate the test service.
<span class="php-quote">'params'</span> - (<span class="php-keyword1">array</span>) Any parameters the factory method might <span class="php-keyword1">require</span> <span class="php-keyword1">for</span>
generating the test service. See the various factories/methods
<span class="php-keyword1">for</span> details.</pre>
Returns
null
|
public
null
|
#
add( string $interface, string $factory, array $method, mixed $params )
Add a new element to the service container.
Add a new element to the service container.
Parameters
- $interface
- $factory The (abbreviated) name of the factory.
- $factory
- <p>$method The factory method that will generate the
service.</p>
- $method
- <p>$params All parameters necessary for creating the
service.</p>
- $params
-
Returns
null
Oaram
string $interface The interface name to register the service with.
|
public
null
|
#
makeGlobal( array $elements )
Export elements from the injector into global scope.
Export elements from the injector into global scope.
Parameters
- $elements
- The elements to export.
Returns
null
|
public
string
|
#
getError( )
Return any potential setup error.
Return any potential setup error.
Returns
string The error.
|
public
Horde_Injector
|
#
getInjector( )
Return the service container.
Return the service container.
Returns
Horde_Injector The injector.
|