TestHelpTopicPlugin.php

Same filename in other branches
  1. 9 core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpTopic/TestHelpTopicPlugin.php
  2. 8.9.x core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpTopic/TestHelpTopicPlugin.php
  3. 11.x core/modules/help/tests/modules/help_topics_test/src/Plugin/HelpTopic/TestHelpTopicPlugin.php

Namespace

Drupal\help_topics_test\Plugin\HelpTopic

File

core/modules/help/tests/modules/help_topics_test/src/Plugin/HelpTopic/TestHelpTopicPlugin.php

View source
<?php

namespace Drupal\help_topics_test\Plugin\HelpTopic;

use Drupal\Core\Cache\Cache;
use Drupal\help\HelpTopicPluginBase;

/**
 * A fake help topic plugin for testing.
 */
class TestHelpTopicPlugin extends HelpTopicPluginBase {
    
    /**
     * {@inheritdoc}
     */
    public function getBody() {
        return [
            '#type' => 'markup',
            '#markup' => $this->pluginDefinition['body'],
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheContexts() {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheTags() {
        return [
            'foobar',
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheMaxAge() {
        return Cache::PERMANENT;
    }

}

Classes

Title Deprecated Summary
TestHelpTopicPlugin A fake help topic plugin for testing.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.