You are here

private function SecuritytxtModuleEnabledTestCase::setConfigurationViaForm in Security.txt 7

Set configuration via the form.

1 call to SecuritytxtModuleEnabledTestCase::setConfigurationViaForm()
SecuritytxtModuleEnabledTestCase::testConfigureForm in ./securitytxt.test
Test configure form.

File

./securitytxt.test, line 396
Tests for securitytxt.module.

Class

SecuritytxtModuleEnabledTestCase
Test case with the Security.txt module enabled.

Code

private function setConfigurationViaForm($enabled, $contact_email, $contact_phone, $contact_url, $encryption_key_url, $policy_url, $acknowledgement_url, $signature_text) {

  // Submit the configure form.
  $edit = array();
  $edit['enabled'] = $enabled;
  $edit['contact_email'] = $contact_email;
  $edit['contact_phone'] = $contact_phone;
  $edit['contact_url'] = $contact_url;
  $edit['encryption_key_url'] = $encryption_key_url;
  $edit['policy_url'] = $policy_url;
  $edit['acknowledgement_url'] = $acknowledgement_url;
  $this
    ->drupalPost(self::SECURITY_TXT_CONF_PATH, $edit, t('Save configuration'));
  $this
    ->assertResponse(200);

  // Submit the sign form.
  $edit = array();
  $edit['signature_text'] = $signature_text;
  $this
    ->drupalPost(self::SECURITY_TXT_CONF_SIGN_PATH, $edit, t('Save configuration'));
  $this
    ->assertResponse(200);
}