You are here

public function ProcessorIntegrationTest::checkNumberFieldBoostIntegration in Search API 8

Tests the UI for the "Number field-based boosting" processor.

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

File

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

Class

ProcessorIntegrationTest
Tests the admin UI for processors.

Namespace

Drupal\Tests\search_api\Functional

Code

public function checkNumberFieldBoostIntegration() {
  $this
    ->enableProcessor('number_field_boost');
  $configuration = [
    'boosts' => [
      'term_field' => [
        'boost_factor' => 8.0,
        'aggregation' => 'avg',
      ],
    ],
  ];
  $form_values = [
    'boosts' => [
      'term_field' => [
        'boost_factor' => Utility::formatBoostFactor(8),
        'aggregation' => 'avg',
      ],
      'parent_reference' => [
        'boost_factor' => Utility::formatBoostFactor(0),
        'aggregation' => 'sum',
      ],
    ],
  ];
  unset($configuration['boosts']['parent_reference']);
  $this
    ->editSettingsForm($configuration, 'number_field_boost', $form_values);
}