Commit fff31e4a authored by Ide Braakman's avatar Ide Braakman Committed by Markus Kalkbrenner
Browse files

Issue #3256305 by idebr, mkalkbrenner: Update calls to deprecated method drupalPostForm()

parent 6da4a0fd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -54,8 +54,8 @@ class SliderIntegrationTest extends FacetsTestBase {

    $this->assertSession()->checkboxNotChecked('edit-facet-settings-slider-status');

    $this->drupalPostForm(NULL, ['widget' => 'slider'], 'Configure widget');
    $this->drupalPostForm(NULL, ['widget' => 'slider'], 'Save');
    $this->submitForm(['widget' => 'slider'], 'Configure widget');
    $this->submitForm(['widget' => 'slider'], 'Save');

    $this->assertSession()->checkboxChecked('edit-facet-settings-slider-status');

+11 −10
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class RestIntegrationTest extends FacetsTestBase {
    $this->drupalGet($facet_edit_page);
    $this->assertSession()->statusCodeEquals(200);

    $this->drupalPostForm(NULL, ['widget' => 'array'], 'Configure widget');
    $this->submitForm(['widget' => 'array'], 'Configure widget');

    $values['widget'] = 'array';
    $values['widget_config[show_numbers]'] = TRUE;
@@ -97,7 +97,7 @@ class RestIntegrationTest extends FacetsTestBase {
    $values['facet_sorting[active_widget_order][status]'] = FALSE;
    $values['facet_settings[query_operator]'] = 'or';
    $values['facet_settings[only_visible_when_facet_source_is_visible]'] = TRUE;
    $this->drupalPostForm(NULL, $values, 'Save');
    $this->submitForm($values, 'Save');

    // Add a new facet to filter by keywords.
    $this->createFacet('Keywords', 'keywords', 'keywords', 'rest_export_1', 'views_rest__search_api_rest_test_view');
@@ -107,7 +107,7 @@ class RestIntegrationTest extends FacetsTestBase {
    $this->drupalGet($facet_edit_page);
    $this->assertSession()->statusCodeEquals(200);

    $this->drupalPostForm(NULL, ['widget' => 'array'], 'Configure widget');
    $this->submitForm(['widget' => 'array'], 'Configure widget');

    $values['widget'] = 'array';
    $values['widget_config[show_numbers]'] = TRUE;
@@ -117,7 +117,7 @@ class RestIntegrationTest extends FacetsTestBase {
    $values['facet_sorting[active_widget_order][status]'] = FALSE;
    $values['facet_settings[query_operator]'] = 'or';
    $values['facet_settings[only_visible_when_facet_source_is_visible]'] = TRUE;
    $this->drupalPostForm(NULL, $values, 'Save');
    $this->submitForm($values, 'Save');

    // Get the output from the rest view and decode it into an array.
    $result = $this->drupalGet('/facets-rest', $get_options);
@@ -332,10 +332,10 @@ class RestIntegrationTest extends FacetsTestBase {
    $this->drupalGet($facet_edit_page);
    $this->assertSession()->statusCodeEquals(200);

    $this->drupalPostForm(NULL, ['widget' => 'checkbox'], 'Configure widget');
    $this->submitForm(['widget' => 'checkbox'], 'Configure widget');
    $this->assertSession()->pageTextContains('The Facet source is a Rest export. Please select a raw widget.');

    $this->drupalPostForm(NULL, ['widget' => 'array'], 'Configure widget');
    $this->submitForm(['widget' => 'array'], 'Configure widget');
    $this->assertSession()->pageTextNotContains('The Facet source is a Rest export. Please select a raw widget.');
  }

@@ -353,8 +353,9 @@ class RestIntegrationTest extends FacetsTestBase {
    $values['widget_config[show_numbers]'] = TRUE;
    $values['facet_settings[url_alias]'] = 'type';
    $values['facet_settings[only_visible_when_facet_source_is_visible]'] = TRUE;
    $this->drupalPostForm('/admin/config/search/facets/type_rest/edit', ['widget' => 'array'], 'Configure widget');
    $this->drupalPostForm(NULL, $values, 'Save');
    $this->drupalGet('/admin/config/search/facets/type_rest/edit');
    $this->submitForm(['widget' => 'array'], 'Configure widget');
    $this->submitForm($values, 'Save');

    $this->drupalGet('facets-page');
    $this->clickLink('item');
@@ -392,8 +393,8 @@ class RestIntegrationTest extends FacetsTestBase {
    $this->assertArrayHasKey('search_results', $json_decoded);

    $this->drupalGet('admin/structure/views/nojs/display/search_api_rest_test_view/rest_export_1/style_options');
    $this->drupalPostForm(NULL, ['style_options[show_facets]' => FALSE], 'Apply');
    $this->drupalPostForm(NULL, [], 'Save');
    $this->submitForm(['style_options[show_facets]' => FALSE], 'Apply');
    $this->submitForm([], 'Save');

    $result = $this->drupalGet('facets-rest', $get_options);
    $this->assertSession()->responseHeaderEquals('content-type', 'application/json');
+4 −3
Original line number Diff line number Diff line
@@ -126,15 +126,16 @@ class HierarchicalFacetIntegrationTest extends FacetsTestBase {
      'facet_settings[use_hierarchy]' => '1',
      'facet_settings[translate_entity][status]' => TRUE,
    ];
    $this->drupalPostForm(NULL, $edit, 'Save');
    $this->submitForm($edit, 'Save');

    $values = [
      'name' => 'Owl',
      'id' => 'owl',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalPostForm(NULL, [], 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');
    $this->submitForm([], 'Save');

    $block = [
      'region' => 'footer',
+41 −26
Original line number Diff line number Diff line
@@ -49,8 +49,9 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'owl',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalPostForm(NULL, [], 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');
    $this->submitForm([], 'Save');

    $this->drupalGet('admin/config/search/facets');
    $this->assertSession()->pageTextContains('Facets Summary');
@@ -71,11 +72,11 @@ class IntegrationTest extends FacetsTestBase {
    $this->assertSession()->checkboxNotChecked('edit-facets-llama-checked');

    // Post the form and check that no facets are checked after saving the form.
    $this->drupalPostForm(NULL, [], 'Save');
    $this->submitForm([], 'Save');
    $this->assertSession()->checkboxNotChecked('edit-facets-llama-checked');

    // Enable a facet and check it's status after saving.
    $this->drupalPostForm(NULL, ['facets[llama][checked]' => TRUE], 'Save');
    $this->submitForm(['facets[llama][checked]' => TRUE], 'Save');
    $this->assertSession()->checkboxChecked('edit-facets-llama-checked');

    $this->configureShowCountProcessor();
@@ -101,15 +102,17 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'owl',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalPostForm(NULL, [], 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');
    $this->submitForm([], 'Save');

    // Edit the summary and enable the giraffe's.
    $summaries = [
      'facets[giraffe][checked]' => TRUE,
      'facets[giraffe][label]' => 'Summary giraffe',
    ];
    $this->drupalPostForm('admin/config/search/facets/facet-summary/owl/edit', $summaries, 'Save');
    $this->drupalGet('admin/config/search/facets/facet-summary/owl/edit');
    $this->submitForm($summaries, 'Save');

    $block = [
      'region' => 'footer',
@@ -144,7 +147,8 @@ class IntegrationTest extends FacetsTestBase {
      'facets[llama][checked]' => TRUE,
      'facets[llama][label]' => 'Summary llama',
    ];
    $this->drupalPostForm('admin/config/search/facets/facet-summary/owl/edit', $summaries, 'Save');
    $this->drupalGet('admin/config/search/facets/facet-summary/owl/edit');
    $this->submitForm($summaries, 'Save');

    $this->drupalGet('search-api-test-fulltext');
    $this->assertSession()->pageTextContains('Displaying 5 search results');
@@ -188,7 +192,8 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'owl',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');

    // Edit the summary and enable the facets.
    $summaries = [
@@ -198,7 +203,7 @@ class IntegrationTest extends FacetsTestBase {
      'facets[llama][label]' => 'Summary llama',
      'facets_summary_settings[show_summary][status]' => TRUE,
    ];
    $this->drupalPostForm(NULL, $summaries, 'Save');
    $this->submitForm($summaries, 'Save');

    $block = [
      'region' => 'footer',
@@ -243,7 +248,8 @@ class IntegrationTest extends FacetsTestBase {
      'id' => $id,
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');
    $this->assertSession()->pageTextContains('Caching of view Search API Test Fulltext search view has been disabled.');

    // Check the view's cache settings again to see if they've been updated.
@@ -271,8 +277,10 @@ class IntegrationTest extends FacetsTestBase {
      'widget' => 'links',
      'widget_config[show_numbers]' => '1',
    ];
    $this->drupalPostForm('admin/config/search/facets/otter/edit', $edit, 'Save');
    $this->drupalPostForm('admin/config/search/facets/wolverine/edit', $edit, 'Save');
    $this->drupalGet('admin/config/search/facets/otter/edit');
    $this->submitForm($edit, 'Save');
    $this->drupalGet('admin/config/search/facets/wolverine/edit');
    $this->submitForm($edit, 'Save');

    // Add a summary.
    $values = [
@@ -280,7 +288,8 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'mustelidae',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');

    // Configure the summary to hide the count.
    $summaries = [
@@ -291,7 +300,7 @@ class IntegrationTest extends FacetsTestBase {
      'facets[wolverine][label]' => 'Summary llama',
      'facets[wolverine][show_count]' => FALSE,
    ];
    $this->drupalPostForm(NULL, $summaries, 'Save');
    $this->submitForm($summaries, 'Save');

    // Place the block.
    $block = [
@@ -314,7 +323,8 @@ class IntegrationTest extends FacetsTestBase {
      'facets[otter][show_count]' => TRUE,
      'facets[wolverine][show_count]' => TRUE,
    ];
    $this->drupalPostForm('admin/config/search/facets/facet-summary/mustelidae/edit', $summaries, 'Save');
    $this->drupalGet('admin/config/search/facets/facet-summary/mustelidae/edit');
    $this->submitForm($summaries, 'Save');

    $this->drupalGet('search-api-test-fulltext');
    $webAssert = $this->assertSession();
@@ -338,8 +348,9 @@ class IntegrationTest extends FacetsTestBase {
      'id' => $id,
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalPostForm(NULL, [], 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');
    $this->submitForm([], 'Save');

    $block_settings = [
      'region' => 'footer',
@@ -358,7 +369,7 @@ class IntegrationTest extends FacetsTestBase {
    $this->drupalGet('admin/config/search/facets/facet-summary/' . $id . '/delete');
    $this->assertSession()->pageTextContains('The listed configuration will be deleted.');
    $this->assertSession()->pageTextContains($block->label());
    $this->drupalPostForm(NULL, [], 'Delete');
    $this->submitForm([], 'Delete');

    $this->drupalGet('admin/structure/block/library/' . $this->defaultTheme);
    $this->assertSession()->pageTextNotContains($name);
@@ -369,7 +380,7 @@ class IntegrationTest extends FacetsTestBase {
   */
  protected function configureShowCountProcessor() {
    $this->assertSession()->checkboxNotChecked('edit-facets-summary-settings-show-count-status');
    $this->drupalPostForm(NULL, ['facets_summary_settings[show_count][status]' => TRUE], 'Save');
    $this->submitForm(['facets_summary_settings[show_count][status]' => TRUE], 'Save');
    $this->assertSession()->checkboxChecked('edit-facets-summary-settings-show-count-status');
    $this->assertSession()->pageTextContains($this->t('Facets Summary Owl has been updated.'));
  }
@@ -379,12 +390,12 @@ class IntegrationTest extends FacetsTestBase {
   */
  protected function configureResetFacetsProcessor() {
    $this->assertSession()->checkboxNotChecked('edit-facets-summary-settings-reset-facets-status');
    $this->drupalPostForm(NULL, ['facets_summary_settings[reset_facets][status]' => TRUE], 'Save');
    $this->submitForm(['facets_summary_settings[reset_facets][status]' => TRUE], 'Save');
    $this->assertSession()->checkboxChecked('edit-facets-summary-settings-reset-facets-status');
    $this->assertSession()->pageTextContains($this->t('Facets Summary Owl has been updated.'));

    $this->assertSession()->fieldExists('facets_summary_settings[reset_facets][settings][link_text]');
    $this->drupalPostForm(NULL, ['facets_summary_settings[reset_facets][settings][link_text]' => 'Reset facets'], 'Save');
    $this->submitForm(['facets_summary_settings[reset_facets][settings][link_text]' => 'Reset facets'], 'Save');
    $this->assertSession()->pageTextContains($this->t('Facets Summary Owl has been updated.'));
    $this->assertSession()->fieldValueEquals('facets_summary_settings[reset_facets][settings][link_text]', 'Reset facets');
  }
@@ -534,7 +545,8 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'kepler',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');

    // Place the block.
    $block = [
@@ -553,7 +565,8 @@ class IntegrationTest extends FacetsTestBase {
      'facets_summary_settings[reset_facets][status]' => 1,
      'facets_summary_settings[reset_facets][settings][link_text]' => 'Reset',
    ];
    $this->drupalPostForm('admin/config/search/facets/facet-summary/kepler/edit', $summaries, 'Save');
    $this->drupalGet('admin/config/search/facets/facet-summary/kepler/edit');
    $this->submitForm($summaries, 'Save');

    // Go to the search view, and check that the summary, as well as the facets
    // are shown on the page.
@@ -582,7 +595,8 @@ class IntegrationTest extends FacetsTestBase {
      'id' => 'trappist',
      'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',
    ];
    $this->drupalPostForm('admin/config/search/facets/add-facet-summary', $values, 'Save');
    $this->drupalGet('admin/config/search/facets/add-facet-summary');
    $this->submitForm($values, 'Save');

    // Place the block.
    $block = [
@@ -599,7 +613,8 @@ class IntegrationTest extends FacetsTestBase {
      'facets_summary_settings[reset_facets][status]' => 1,
      'facets_summary_settings[reset_facets][settings][link_text]' => 'Reset',
    ];
    $this->drupalPostForm('admin/config/search/facets/facet-summary/trappist/edit', $summaries, 'Save');
    $this->drupalGet('admin/config/search/facets/facet-summary/trappist/edit');
    $this->submitForm($summaries, 'Save');

    // Go to the search view, and check that the summary, as well as the facets
    // are shown on the page.
+2 −2
Original line number Diff line number Diff line
@@ -99,8 +99,8 @@ class AggregatedFieldTest extends FacetsTestBase {
    ];

    // Try filling out the form, and configure it to use the aggregated field.
    $this->drupalPostForm(NULL, ['facet_source_id' => 'search_api:views_page__search_api_test_view__page_1'], 'Configure facet source');
    $this->drupalPostForm(NULL, $form_values, 'Save');
    $this->submitForm(['facet_source_id' => 'search_api:views_page__search_api_test_view__page_1'], 'Configure facet source');
    $this->submitForm($form_values, 'Save');

    // Check that nothing breaks.
    $this->assertSession()->statusCodeEquals(200);
Loading