You are here

public function TestDerivativeDiscoveryWithObject::getDerivativeDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject::getDerivativeDefinitions()
  2. 9 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject::getDerivativeDefinitions()

Parameters

array $base_plugin_definition: An associative array defining the base plugin.

Return value

array

File

core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php, line 33

Class

TestDerivativeDiscoveryWithObject
Defines test derivative discovery using an object..

Namespace

Drupal\Tests\Core\Plugin\Discovery

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $plugins = [];
  for ($i = 0; $i < 2; $i++) {
    $plugins['test_discovery_' . $i] = $base_plugin_definition;
  }
  return $plugins;
}