Drupal 8  8.0.2
LazyPluginCollectionTestBase Class Reference
Inheritance diagram for LazyPluginCollectionTestBase:

Public Member Functions

 returnPluginMap ($plugin_id)
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 setupPluginCollection (\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder $create_count=NULL)
 
 getPluginMock ($plugin_id, array $definition)
 
 getPluginDefinitions ()
 
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 
 getRandomGenerator ()
 
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 
 getBlockMockWithMachineName ($machine_name)
 
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 
 getClassResolverStub ()
 

Protected Attributes

 $pluginManager
 
 $defaultPluginCollection
 
 $pluginInstances
 
 $config
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Provides a base class for plugin collection tests.

Member Function Documentation

getPluginDefinitions ( )
protected

Returns some example plugin definitions.

Returns
array The example plugin definitions.

Referenced by DefaultSingleLazyPluginCollectionTest\setupPluginCollection(), LazyPluginCollectionTestBase\setupPluginCollection(), and DefaultLazyPluginCollectionTest\testHas().

Here is the caller graph for this function:

getPluginMock (   $plugin_id,
array  $definition 
)
protected

Returns a mocked plugin object.

Parameters
string$plugin_idThe plugin ID.
array$definitionThe plugin definition.
Returns
|

Referenced by DefaultSingleLazyPluginCollectionTest\setupPluginCollection(), and LazyPluginCollectionTestBase\setupPluginCollection().

Here is the caller graph for this function:

returnPluginMap (   $plugin_id)

Return callback for createInstance.

Parameters
string$plugin_idThe plugin ID to return the mock plugin for.
Returns
| The mock plugin object.
setupPluginCollection ( \PHPUnit_Framework_MockObject_Matcher_InvokedRecorder  $create_count = NULL)
protected

Sets up the default plugin collection.

Parameters
\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder | null$create_count(optional) The number of times that createInstance() is expected to be called. For example, $this->any(), $this->once(), $this->exactly(6). Defaults to $this->never().

References Drupal\config(), LazyPluginCollectionTestBase\getPluginDefinitions(), and LazyPluginCollectionTestBase\getPluginMock().

Referenced by DefaultLazyPluginCollectionTest\testAddInstanceId(), DefaultLazyPluginCollectionTest\testClear(), DefaultLazyPluginCollectionTest\testConfigurableGetConfiguration(), DefaultLazyPluginCollectionTest\testConfigurableSetConfiguration(), DefaultLazyPluginCollectionTest\testCount(), DefaultLazyPluginCollectionTest\testGet(), DefaultLazyPluginCollectionTest\testGetConfiguration(), DefaultLazyPluginCollectionTest\testGetNotExistingPlugin(), DefaultLazyPluginCollectionTest\testHas(), DefaultLazyPluginCollectionTest\testRemoveInstanceId(), DefaultLazyPluginCollectionTest\testSet(), DefaultLazyPluginCollectionTest\testSetInstanceConfiguration(), and DefaultLazyPluginCollectionTest\testSortHelper().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$config
protected
Initial value:
= array(
'banana' => array('id' => 'banana', 'key' => 'value'),
'cherry' => array('id' => 'cherry', 'key' => 'value'),
'apple' => array('id' => 'apple', 'key' => 'value'),
)

The documentation for this class was generated from the following file: