class HelpSearchPluginTest in Drupal 10
Same name and namespace in other branches
- 9 core/modules/help_topics/tests/src/Kernel/HelpSearchPluginTest.php \Drupal\Tests\help_topics\Kernel\HelpSearchPluginTest
Tests search plugin behaviors.
@group help_topics
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\help_topics\Kernel\HelpSearchPluginTest
Expanded class hierarchy of HelpSearchPluginTest
See also
\Drupal\help_topics\Plugin\Search\HelpSearch
File
- core/
modules/ help_topics/ tests/ src/ Kernel/ HelpSearchPluginTest.php, line 16
Namespace
Drupal\Tests\help_topics\KernelView source
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());
}
}