protected function ProcessorIntegrationTest::checkSortByRaw in Facets 8
Tests the display order.
1 call to ProcessorIntegrationTest::checkSortByRaw()
- ProcessorIntegrationTest::testSortingWidgets in tests/
src/ Functional/ ProcessorIntegrationTest.php  - Tests the for sorting processors in the frontend with a 'keywords' facet.
 
File
- tests/
src/ Functional/ ProcessorIntegrationTest.php, line 660  
Class
- ProcessorIntegrationTest
 - Tests the processor functionality.
 
Namespace
Drupal\Tests\facets\FunctionalCode
protected function checkSortByRaw() {
  $this
    ->disableAllFacetSorts();
  $form = [
    'facet_sorting[raw_value_widget_order][status]' => TRUE,
  ];
  $this
    ->drupalPostForm($this->editForm, $form, 'Save');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertStringPosition('grape', 'strawberry');
  $this
    ->assertStringPosition('apple', 'banana');
  $form = [
    'facet_sorting[raw_value_widget_order][status]' => TRUE,
    'facet_sorting[raw_value_widget_order][settings][sort]' => 'DESC',
  ];
  $this
    ->drupalPostForm($this->editForm, $form, 'Save');
  $this
    ->drupalGet('search-api-test-fulltext');
  $this
    ->assertStringPosition('strawberry', 'grape');
  $this
    ->assertStringPosition('banana', 'apple');
  $form = [
    'facet_sorting[raw_value_widget_order][status]' => FALSE,
  ];
  $this
    ->drupalPostForm($this->editForm, $form, 'Save');
}