class HelpSearchPluginTest

Same name in this branch
  1. main core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php \Drupal\Tests\help\Kernel\HelpSearchPluginTest
Same name and namespace in other branches
  1. 11.x core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php \Drupal\Tests\help\Kernel\HelpSearchPluginTest
  2. 10 core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php \Drupal\Tests\help\Kernel\HelpSearchPluginTest
  3. 9 core/modules/help_topics/tests/src/Kernel/HelpSearchPluginTest.php \Drupal\Tests\help_topics\Kernel\HelpSearchPluginTest

Tests search plugin behaviors.

Attributes

#[Group('help')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of HelpSearchPluginTest

See also

\Drupal\search_help\Plugin\Search\SearchHelpSearch

File

core/modules/search/modules/search_help/tests/src/Kernal/HelpSearchPluginTest.php, line 18

Namespace

Drupal\Tests\search_help\Kernel
View source
class HelpSearchPluginTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'help',
    'search',
    'search_help',
  ];
  
  /**
   * Tests search plugin annotation and interfaces.
   */
  public function testAnnotation() : void {
    /** @var \Drupal\search\SearchPluginManager $manager */
    $manager = \Drupal::service('plugin.manager.search');
    /** @var \Drupal\search_help\Plugin\Search\SearchHelpSearch $plugin */
    $plugin = $manager->createInstance('help_search');
    $this->assertInstanceOf(AccessibleInterface::class, $plugin);
    $this->assertInstanceOf(SearchIndexingInterface::class, $plugin);
    $this->assertSame('Help', (string) $plugin->getPluginDefinition()['title']);
    $this->assertTrue($plugin->usesAdminTheme());
  }

}

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