You are here

protected function BlockFieldSelectionTest::setUpSelectionInstance in Block field 8

Returns a plugin instance from BlockFieldSelectionManager.

Parameters

string $plugin_id: A plugin id.

array $settings: A configuration settings array.

Return value

\Drupal\block_field\BlockFieldSelectionInterface Returns an instance of the plugin with passed settings.

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to BlockFieldSelectionTest::setUpSelectionInstance()
BlockFieldSelectionTest::testIsSerializable in tests/src/Kernel/BlockFieldSelectionTest.php
Test if BlockFieldSelectionInterface plugins are serializable.

File

tests/src/Kernel/BlockFieldSelectionTest.php, line 32

Class

BlockFieldSelectionTest
Tests blockFieldSelectionManager plugins.

Namespace

Drupal\Tests\block_field\Kernel

Code

protected function setUpSelectionInstance($plugin_id = 'blocks', array $settings = []) {
  return $this->container
    ->get('plugin.manager.block_field_selection')
    ->createInstance($plugin_id, $settings);
}