class TestDerivativeDiscovery
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery
- 10 core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery
- 11.x core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery
Defines test derivative discovery.
Hierarchy
- class \Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery implements \Drupal\Component\Plugin\Derivative\DeriverInterface
Expanded class hierarchy of TestDerivativeDiscovery
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ Discovery/ TestDerivativeDiscovery.php, line 10
Namespace
Drupal\Tests\Core\Plugin\DiscoveryView source
class TestDerivativeDiscovery implements DeriverInterface {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
$definitions = $this->getDerivativeDefinitions($base_plugin_definition);
return $definitions[$derivative_id];
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$plugins = [];
for ($i = 0; $i < 2; $i++) {
$plugins['test_discovery_' . $i] = $base_plugin_definition;
}
return $plugins;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
TestDerivativeDiscovery::getDerivativeDefinition | public | function | Gets the definition of a derivative plugin. | Overrides DeriverInterface::getDerivativeDefinition |
TestDerivativeDiscovery::getDerivativeDefinitions | public | function | Gets the definition of all derivatives of a base plugin. | Overrides DeriverInterface::getDerivativeDefinitions |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.