You are here

protected function ProcessorIntegrationTest::checkHideNonNarrowingProcessor in Facets 8

Tests hiding non-narrowing results.

1 call to ProcessorIntegrationTest::checkHideNonNarrowingProcessor()
ProcessorIntegrationTest::testProcessorIntegration in tests/src/Functional/ProcessorIntegrationTest.php
Tests the for processors in the frontend with a 'keywords' facet.

File

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

Class

ProcessorIntegrationTest
Tests the processor functionality.

Namespace

Drupal\Tests\facets\Functional

Code

protected function checkHideNonNarrowingProcessor() {
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertSession()
    ->pageTextContains('Displaying 10 search results');
  $this
    ->assertFacetLabel('apple');
  $this
    ->clickLink('apple');
  $this
    ->assertSession()
    ->pageTextContains('Displaying 4 search results');
  $this
    ->assertFacetLabel('grape');
  $form = [
    'facet_settings[hide_non_narrowing_result_processor][status]' => TRUE,
  ];
  $this
    ->drupalPostForm($this->editForm, $form, 'Save');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertSession()
    ->pageTextContains('Displaying 10 search results');
  $this
    ->assertFacetLabel('apple');
  $this
    ->clickLink('apple');
  $this
    ->assertSession()
    ->pageTextContains('Displaying 4 search results');
  $this
    ->assertSession()
    ->linkNotExists('grape');
  $form = [
    'facet_settings[hide_non_narrowing_result_processor][status]' => FALSE,
  ];
  $this
    ->drupalPostForm($this->editForm, $form, 'Save');
}