You are here

public function ContactSitewideTest::updateContactForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/contact/tests/src/Functional/ContactSitewideTest.php \Drupal\Tests\contact\Functional\ContactSitewideTest::updateContactForm()

Updates a form.

Parameters

string $id: The form machine name.

string $label: The form label.

string $recipients: The list of recipient email addresses.

string $reply: The auto-reply text that is sent to a user upon completing the contact form.

bool $selected: A Boolean indicating whether the form should be selected by default.

string $message: The message that will be displayed to a user upon completing the contact form.

string $redirect: The path where user will be redirect after this form has been submitted..

1 call to ContactSitewideTest::updateContactForm()
ContactSitewideTest::testSiteWideContact in core/modules/contact/tests/src/Functional/ContactSitewideTest.php
Tests configuration options and the site-wide contact form.

File

core/modules/contact/tests/src/Functional/ContactSitewideTest.php, line 548

Class

ContactSitewideTest
Tests site-wide contact form functionality.

Namespace

Drupal\Tests\contact\Functional

Code

public function updateContactForm($id, $label, $recipients, $reply, $selected, $message = 'Your message has been sent.', $redirect = '/') {
  $edit = [];
  $edit['label'] = $label;
  $edit['recipients'] = $recipients;
  $edit['reply'] = $reply;
  $edit['selected'] = $selected ? TRUE : FALSE;
  $edit['message'] = $message;
  $edit['redirect'] = $redirect;
  $this
    ->drupalGet("admin/structure/contact/manage/{$id}");
  $this
    ->submitForm($edit, 'Save');
}