You are here

public function ProcessorIntegrationTest::testPreQueryProcessor in Facets 8

Test pre query processor.

File

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

Class

ProcessorIntegrationTest
Tests the processor functionality.

Namespace

Drupal\Tests\facets\Functional

Code

public function testPreQueryProcessor() {
  $facet_name = "Eamus Catuli";
  $facet_id = "eamus_catuli";
  $editForm = 'admin/config/search/facets/' . $facet_id . '/edit';
  $this
    ->createFacet($facet_name, $facet_id);
  $edit = [
    'facet_settings[test_pre_query][status]' => TRUE,
    'facet_settings[test_pre_query][settings][test_value]' => 'Llama',
  ];
  $this
    ->drupalPostForm($editForm, $edit, 'Save');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Llama');
}