You are here

public function ProcessorIntegrationTest::checkIgnoreCharactersIntegration in Search API 8

Tests the UI for the "Ignore characters" processor.

1 call to ProcessorIntegrationTest::checkIgnoreCharactersIntegration()
ProcessorIntegrationTest::testProcessorIntegration in tests/src/Functional/ProcessorIntegrationTest.php
Tests the admin UI for processors.

File

tests/src/Functional/ProcessorIntegrationTest.php, line 525

Class

ProcessorIntegrationTest
Tests the admin UI for processors.

Namespace

Drupal\Tests\search_api\Functional

Code

public function checkIgnoreCharactersIntegration() {
  $configuration = [
    'ignorable' => ':)',
  ];
  $this
    ->checkValidationError($configuration, 'ignore_character', 'The entered text is no valid regular expression.');
  $configuration = $form_values = [
    'all_fields' => TRUE,
    'ignorable' => '[¿¡!?,.]',
  ];
  $form_values['strip']['character_sets'] = [
    'Pc' => 'Pc',
    'Pd' => 'Pd',
    'Pe' => 'Pe',
    'Pf' => 'Pf',
    'Pi' => 'Pi',
    'Po' => 'Po',
    'Ps' => 'Ps',
    'Cc' => 'Cc',
    'Cf' => FALSE,
    'Co' => FALSE,
    'Mc' => FALSE,
    'Me' => FALSE,
    'Mn' => FALSE,
    'Sc' => FALSE,
    'Sk' => FALSE,
    'Sm' => FALSE,
    'So' => FALSE,
    'Zl' => FALSE,
    'Zp' => FALSE,
    'Zs' => FALSE,
  ];
  $configuration['ignorable_classes'] = array_filter($form_values['strip']['character_sets']);
  sort($configuration['ignorable_classes']);
  $this
    ->editSettingsForm($configuration, 'ignore_character', $form_values);
}