You are here

class TestHelpTopicDeriver in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/Deriver/TestHelpTopicDeriver.php \Drupal\help_topics_test\Plugin\Deriver\TestHelpTopicDeriver
  2. 9 core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/Deriver/TestHelpTopicDeriver.php \Drupal\help_topics_test\Plugin\Deriver\TestHelpTopicDeriver

A test discovery deriver for fake help topics.

Hierarchy

Expanded class hierarchy of TestHelpTopicDeriver

1 string reference to 'TestHelpTopicDeriver'
help_topics_test.help_topics.yml in core/modules/help_topics/tests/modules/help_topics_test/help_topics_test.help_topics.yml
core/modules/help_topics/tests/modules/help_topics_test/help_topics_test.help_topics.yml

File

core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/Deriver/TestHelpTopicDeriver.php, line 10

Namespace

Drupal\help_topics_test\Plugin\Deriver
View source
class TestHelpTopicDeriver implements DeriverInterface {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $prefix = $base_plugin_definition['id'];
    $id = 'test_derived_topic';
    $plugin_id = $prefix . ':' . $id;
    $definitions[$id] = [
      'plugin_id' => $plugin_id,
      'id' => $plugin_id,
      'class' => 'Drupal\\help_topics_test\\Plugin\\HelpTopic\\TestHelpTopicPlugin',
      'label' => 'Label for ' . $id,
      'body' => 'Body for ' . $id,
      'top_level' => TRUE,
      'related' => [],
      'provider' => 'help_topics_test',
    ];
    return $definitions;
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
    return $base_plugin_definition;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TestHelpTopicDeriver::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
TestHelpTopicDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverInterface::getDerivativeDefinitions