You are here

protected function IntegrationTest::configureFilter in Search API 8

Tests that configuring a processor works.

2 calls to IntegrationTest::configureFilter()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Search API's admin UI.
IntegrationTest::testIntegerIndex in tests/src/Functional/IntegrationTest.php
Tests what happens when an index has an integer as id/label.

File

tests/src/Functional/IntegrationTest.php, line 1186

Class

IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function configureFilter() {
  $edit = [
    'status[ignorecase]' => 1,
    'processors[ignorecase][settings][fields][title]' => 'title',
    'processors[ignorecase][settings][fields][field__field_]' => FALSE,
  ];
  $this
    ->drupalGet($this
    ->getIndexPath('processors'));
  $this
    ->submitForm($edit, 'Save');
  $index = $this
    ->getIndex(TRUE);
  try {
    $configuration = $index
      ->getProcessor('ignorecase')
      ->getConfiguration();
    unset($configuration['weights']);
    $expected = [
      'fields' => [
        'title',
      ],
      'all_fields' => FALSE,
    ];
    $this
      ->assertEquals($expected, $configuration, 'Title field enabled for ignore case filter.');
  } catch (SearchApiException $e) {
    $this
      ->fail('"Ignore case" processor not enabled.');
  }
  $this
    ->assertSession()
    ->pageTextContains('The indexing workflow was successfully edited.');
}