MockDbTablePluginManager
extends PluginManager
in package
Uses
MockContainerTrait
DB table plugin container that produces mock objects.
Tags
Table of Contents
- $aliases : array<string|int, mixed>
- Default plugin aliases.
- $disabled : array<string|int, string>
- Disabled services.
- $factories : array<string|int, mixed>
- Default plugin factories.
- $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
- Retrieve a plugin
- has() : bool
- Returns true if the container can return an entry for the given identifier.
- set() : object
- Explicitly set an entry in the container.
- setAlias() : object
- Add an alias.
- validate() : void
- Validate the plugin
- getExpectedInterface() : string
- Return the name of the base class or interface that plug-ins must conform to.
- getNormalizedServiceName() : string
- Hack for backward compatibility with services defined under ServiceManager v2, when service names were case-insensitive.
Properties
$aliases
Default plugin aliases.
protected
array<string|int, mixed>
$aliases
= ['accesstoken' => \VuFind\Db\Table\AccessToken::class, 'authhash' => \VuFind\Db\Table\AuthHash::class, 'changetracker' => \VuFind\Db\Table\ChangeTracker::class, 'comments' => \VuFind\Db\Table\Comments::class, 'externalsession' => \VuFind\Db\Table\ExternalSession::class, 'feedback' => \VuFind\Db\Table\Feedback::class, 'logintoken' => \VuFind\Db\Table\LoginToken::class, 'oairesumption' => \VuFind\Db\Table\OaiResumption::class, 'ratings' => \VuFind\Db\Table\Ratings::class, 'record' => \VuFind\Db\Table\Record::class, 'resource' => \VuFind\Db\Table\Resource::class, 'resourcetags' => \VuFind\Db\Table\ResourceTags::class, 'search' => \VuFind\Db\Table\Search::class, 'session' => \VuFind\Db\Table\Session::class, 'shortlinks' => \VuFind\Db\Table\Shortlinks::class, 'tags' => \VuFind\Db\Table\Tags::class, 'user' => \VuFind\Db\Table\User::class, 'usercard' => \VuFind\Db\Table\UserCard::class, 'userlist' => \VuFind\Db\Table\UserList::class, 'userresource' => \VuFind\Db\Table\UserResource::class]
$disabled
Disabled services.
protected
array<string|int, string>
$disabled
= []
$factories
Default plugin factories.
protected
array<string|int, mixed>
$factories
= [\VuFind\Db\Table\AccessToken::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\AuthHash::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\ChangeTracker::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Comments::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\ExternalSession::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Feedback::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\LoginToken::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\OaiResumption::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Ratings::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Record::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Resource::class => \VuFind\Db\Table\ResourceFactory::class, \VuFind\Db\Table\ResourceTags::class => \VuFind\Db\Table\CaseSensitiveTagsFactory::class, \VuFind\Db\Table\Search::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Session::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Shortlinks::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\Tags::class => \VuFind\Db\Table\CaseSensitiveTagsFactory::class, \VuFind\Db\Table\User::class => \VuFind\Db\Table\UserFactory::class, \VuFind\Db\Table\UserCard::class => \VuFind\Db\Table\GatewayFactory::class, \VuFind\Db\Table\UserList::class => \VuFind\Db\Table\UserListFactory::class, \VuFind\Db\Table\UserResource::class => \VuFind\Db\Table\GatewayFactory::class]
$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()
Retrieve a plugin
public
get(string $name[, null|array<string|int, mixed> $options = null ]) : mixed
Parameters
- $name : string
-
Name of plugin
- $options : null|array<string|int, mixed> = null
-
Options to use when creating the instance.
Return values
mixed —has()
Returns true if the container can return an entry for the given identifier.
public
has(string $id) : bool
Returns false otherwise.
Parameters
- $id : string
-
Identifier of the entry to look for.
Return values
bool —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
Tags
Return values
void —getExpectedInterface()
Return the name of the base class or interface that plug-ins must conform to.
protected
abstract getExpectedInterface() : string
Return values
string —getNormalizedServiceName()
Hack for backward compatibility with services defined under ServiceManager v2, when service names were case-insensitive.
protected
getNormalizedServiceName(string $name) : string
TODO: set up aliases and/or normalize code to eliminate the need for this.
Parameters
- $name : string
-
Service name