You are here

protected function BackendTestBase::enableHtmlFilter in Search API 8

Enables the "HTML Filter" processor for the index.

1 call to BackendTestBase::enableHtmlFilter()
BackendTestBase::testBackend in tests/src/Kernel/BackendTestBase.php
Tests various indexing scenarios for the search backend.

File

tests/src/Kernel/BackendTestBase.php, line 171

Class

BackendTestBase
Provides a base class for backend tests.

Namespace

Drupal\Tests\search_api\Kernel

Code

protected function enableHtmlFilter() {
  $index = $this
    ->getIndex();

  /** @var \Drupal\search_api\Processor\ProcessorInterface $processor */
  $processor = \Drupal::getContainer()
    ->get('search_api.plugin_helper')
    ->createProcessorPlugin($index, 'html_filter');
  $index
    ->addProcessor($processor)
    ->save();
  $this
    ->assertArrayHasKey('html_filter', $index
    ->getProcessors(), 'HTML filter processor is added.');
}