MockConfigPluginManager
extends PluginManager
in package
Uses
MockContainerTrait
VuFind config plugin container that produces mock objects.
Tags
Table of Contents
- $disabled : array<string|int, string>
- Disabled services.
- $mockAliases : array<string|int, mixed>
- Common service aliases.
- $mockServices : array<string|int, mixed>
- Services
- $test : TestCase
- Test case (for building mock objects)
- __construct() : mixed
- Constructor
- createMock() : mixed
- Create a mock object.
- disable() : object
- Disable a service
- get() : mixed
- Finds an entry of the container by its identifier and returns it.
- has() : bool
- Returns true if the container can return an entry for the given identifier.
- reload() : Config
- Reload a configuration and return the new version
- set() : object
- Explicitly set an entry in the container.
- setAlias() : object
- Add an alias.
- validate() : void
- Validate the plugin
Properties
$disabled
Disabled services.
protected
array<string|int, string>
$disabled
= []
$mockAliases
Common service aliases.
protected
array<string|int, mixed>
$mockAliases
= ['ViewHelperManager' => \Laminas\View\HelperPluginManager::class]
$mockServices
Services
protected
array<string|int, mixed>
$mockServices
= []
$test
Test case (for building mock objects)
protected
TestCase
$test
Methods
__construct()
Constructor
public
__construct([mixed $configOrContainerInstance = null ][, array<string|int, mixed> $v3config = [] ]) : mixed
Make sure plugins are properly initialized.
Parameters
- $configOrContainerInstance : mixed = null
-
Configuration or container instance
- $v3config : array<string|int, mixed> = []
-
If $configOrContainerInstance is a container, this value will be passed to the parent constructor.
Return values
mixed —createMock()
Create a mock object.
public
createMock(string $id[, array<string|int, mixed> $methods = [] ]) : mixed
Parameters
- $id : string
-
Identifier of the service to mock out.
- $methods : array<string|int, mixed> = []
-
Methods to mock.
Return values
mixed —disable()
Disable a service
public
disable(string $id) : object
Parameters
- $id : string
-
Identifier of the entry to disable.
Return values
object —get()
Finds an entry of the container by its identifier and returns it.
public
get(string $rawId[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $rawId : string
-
Identifier of the entry to look for.
- $options : array<string|int, mixed> = []
-
Additional options (used for method list here)
Return values
mixed —has()
Returns true if the container can return an entry for the given identifier.
public
has(string $rawId) : bool
Returns false otherwise.
Parameters
- $rawId : string
-
Identifier of the entry to look for.
Return values
bool —reload()
Reload a configuration and return the new version
public
reload(string $id) : Config
Parameters
- $id : string
-
Service identifier
Return values
Config —set()
Explicitly set an entry in the container.
public
set(string $id, mixed $obj) : object
Parameters
- $id : string
-
Identifier of the entry to set.
- $obj : mixed
-
The service to set.
Return values
object —setAlias()
Add an alias.
public
setAlias(string $alias, string $target) : object
Parameters
- $alias : string
-
Alias of the service.
- $target : string
-
Target service.
Return values
object —validate()
Validate the plugin
public
validate(mixed $plugin) : void
Checks that the filter loaded is either a valid callback or an instance of FilterInterface.
Parameters
- $plugin : mixed
-
Plugin to validate