public function SecuritytxtModuleEnabledTestCase::testConfigureForm in Security.txt 7
Test configure form.
File
- ./
securitytxt.test, line 329 - Tests for securitytxt.module.
Class
- SecuritytxtModuleEnabledTestCase
- Test case with the Security.txt module enabled.
Code
public function testConfigureForm() {
// Configuration values used for this test.
$enabled = TRUE;
$contact_email = 'contact@example.com';
$contact_phone = '+44-1632-123456';
$contact_url = 'https://example.com/contact';
$encryption_key_url = 'https://example.com/key';
$policy_url = 'https://example.com/policy';
$acknowledgement_url = 'https://example.com/acknowledgements';
$signature_text = 'THIS IS THE SIGNATURE TEXT';
// Log in as administrator.
$this
->drupalLogin($this->administratorUser);
// Check that the security.txt file is disabled.
$this
->checkSecurityTxtFile(FALSE, $contact_email, $contact_phone, $contact_url, $encryption_key_url, $policy_url, $acknowledgement_url);
// Set the configuration via the form.
$this
->setConfigurationViaForm($enabled, $contact_email, $contact_phone, $contact_url, $encryption_key_url, $policy_url, $acknowledgement_url, $signature_text);
// Check the security.txt and security.txt.sig files.
$this
->checkSecurityTxtFile($enabled, $contact_email, $contact_phone, $contact_url, $encryption_key_url, $policy_url, $acknowledgement_url);
$this
->checkSecurityTxtSigFile($enabled, $signature_text);
}