diff --git a/src/Tests/ProcessorIntegrationTest.php b/src/Tests/ProcessorIntegrationTest.php index c1f083c..a8cbfd0 100644 --- a/src/Tests/ProcessorIntegrationTest.php +++ b/src/Tests/ProcessorIntegrationTest.php @@ -134,15 +134,16 @@ class ProcessorIntegrationTest extends WebTestBase { public function testResultSorting() { $id = 'burrowing_owl'; $name = 'Burrowing owl'; + $this->editForm = 'admin/config/search/facets/' . $id . '/edit'; $this->createFacet($name, $id, 'keywords'); + $this->disableAllFacetSorts(); $values = [ 'facet_sorting[display_value_widget_order][status]' => TRUE, 'widget_configs[show_numbers]' => TRUE, ]; - $this->drupalGet('admin/config/search/facets/' . $id . '/edit'); - $this->drupalPostForm(NULL, $values, $this->t('Save')); + $this->drupalPostForm($this->editForm, $values, $this->t('Save')); $expected_results = [ 'apple', @@ -167,9 +168,8 @@ class ProcessorIntegrationTest extends WebTestBase { $values['processors[count_widget_order][weights][build]'] = 1; $values['facet_sorting[display_value_widget_order][status]'] = TRUE; $values['processors[display_value_widget_order][weights][build]'] = 2; - $this->drupalGet('admin/config/search/facets/' . $id . '/edit'); - $this->disableAllFacetSorts('admin/config/search/facets/' . $id . '/edit'); - $this->drupalPostForm(NULL, $values, $this->t('Save')); + $this->disableAllFacetSorts(); + $this->drupalPostForm($this->editForm, $values, $this->t('Save')); $expected_results = [ 'banana', @@ -191,11 +191,8 @@ class ProcessorIntegrationTest extends WebTestBase { $values['facet_sorting[display_value_widget_order][status]'] = TRUE; $values['facet_sorting[count_widget_order][status]'] = TRUE; $values['facet_sorting[count_widget_order][settings][sort]'] = 'ASC'; - $this->drupalGet('admin/config/search/facets/' . $id . '/edit'); - $this->drupalPostForm(NULL, $values, $this->t('Save')); - $this->assertFieldChecked( - 'edit-facet-sorting-display-value-widget-order-status' - ); + $this->drupalPostForm($this->editForm, $values, $this->t('Save')); + $this->assertFieldChecked('edit-facet-sorting-display-value-widget-order-status'); $this->assertFieldChecked('edit-facet-sorting-count-widget-order-status'); $expected_results = [ @@ -510,10 +507,10 @@ class ProcessorIntegrationTest extends WebTestBase { 'facet_sorting[active_widget_order][status]' => FALSE, ]; - if(!$path){ + if (!$path) { $path = $this->editForm; } $this->drupalPostForm($path, $settings, $this->t('Save')); } -} \ No newline at end of file +}