protected function ProcessorIntegrationTest::checkSortByCount in Facets 8
Tests the active widget order.
1 call to ProcessorIntegrationTest::checkSortByCount()
- 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 599
Class
- ProcessorIntegrationTest
- Tests the processor functionality.
Namespace
Drupal\Tests\facets\FunctionalCode
protected function checkSortByCount() {
$this
->disableAllFacetSorts();
$form = [
'widget_config[show_numbers]' => TRUE,
'facet_sorting[count_widget_order][status]' => TRUE,
'facet_sorting[count_widget_order][settings][sort]' => 'ASC',
];
$this
->drupalPostForm($this->editForm, $form, 'Save');
$this
->drupalGet('search-api-test-fulltext');
$this
->assertStringPosition('banana', 'apple');
$this
->assertStringPosition('banana', 'strawberry');
$this
->assertStringPosition('apple', 'orange');
$form = [
'facet_sorting[count_widget_order][status]' => TRUE,
'facet_sorting[count_widget_order][settings][sort]' => 'DESC',
];
$this
->drupalPostForm($this->editForm, $form, 'Save');
$this
->drupalGet('search-api-test-fulltext');
$this
->assertStringPosition('apple', 'banana');
$this
->assertStringPosition('strawberry', 'banana');
$this
->assertStringPosition('orange', 'apple');
$form = [
'widget_config[show_numbers]' => FALSE,
'facet_sorting[count_widget_order][status]' => FALSE,
];
$this
->drupalPostForm($this->editForm, $form, 'Save');
}