Skip to content
Snippets Groups Projects
Unverified Commit 33c16bf2 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3087879 by andypost, jhodgdon, alexpott: Use admin theme annotation for help topics search

parent bd4c5f07
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,8 @@
*
* @SearchPlugin(
* id = "help_search",
* title = @Translation("Help")
* title = @Translation("Help"),
* use_admin_theme = TRUE,
* )
*
* @internal
......
<?php
namespace Drupal\Tests\help_topics\Kernel;
use Drupal\Core\Access\AccessibleInterface;
use Drupal\KernelTests\KernelTestBase;
use Drupal\search\Plugin\SearchIndexingInterface;
/**
* Tests search plugin behaviors.
*
* @group help_topics
*
* @see \Drupal\help_topics\Plugin\Search\HelpSearch
*/
class HelpSearchPluginTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['help', 'help_topics', 'search'];
/**
* Tests search plugin annotation and interfaces.
*/
public function testAnnotation() {
/** @var \Drupal\search\SearchPluginManager $manager */
$manager = \Drupal::service('plugin.manager.search');
/** @var \Drupal\help_topics\Plugin\Search\HelpSearch $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());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment