You are here

public function PluginManagerBaseTest::createInstanceCallback in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php \Drupal\Tests\Component\Plugin\PluginManagerBaseTest::createInstanceCallback()

A callback method for mocking FactoryInterface objects.

File

core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php, line 22
Contains \Drupal\Tests\Component\Plugin\PluginManagerBaseTest.

Class

PluginManagerBaseTest
@coversDefaultClass \Drupal\Component\Plugin\PluginManagerBase @group Plugin

Namespace

Drupal\Tests\Component\Plugin

Code

public function createInstanceCallback() {
  $args = func_get_args();
  $plugin_id = $args[0];
  $configuration = $args[1];
  if ('invalid' == $plugin_id) {
    throw new PluginNotFoundException($plugin_id);
  }
  return array(
    'plugin_id' => $plugin_id,
    'configuration' => $configuration,
  );
}