You are here

protected function SecuritytxtBaseTest::getValidConfiguration in Security.txt 8

Get a valid configuration array.

Return value

array An array of valid configuration values.

1 call to SecuritytxtBaseTest::getValidConfiguration()
SecuritytxtBaseTest::submitValidConfiguration in tests/src/Functional/SecuritytxtBaseTest.php
Submit a valid configuration to both the 'Configure' and 'Sign' forms.

File

tests/src/Functional/SecuritytxtBaseTest.php, line 68

Class

SecuritytxtBaseTest
Defines a base class for testing the Security.txt module.

Namespace

Drupal\Tests\securitytxt\Functional

Code

protected function getValidConfiguration() {
  $valid_configuration = [];
  $valid_configuration['enabled'] = TRUE;
  $valid_configuration['contact_email'] = $this
    ->randomMachineName(16) . '@example.com';
  $valid_configuration['contact_phone'] = '+44-7700-900' . rand(100, 999);
  $valid_configuration['contact_url'] = 'https://example.com/contact/' . $this
    ->randomMachineName(16);
  $valid_configuration['encryption_key_url'] = 'https://example.com/key/' . $this
    ->randomMachineName(16);
  $valid_configuration['policy_url'] = 'https://example.com/policy/' . $this
    ->randomMachineName(16);
  $valid_configuration['acknowledgement_url'] = 'https://example.com/acknowledgement/' . $this
    ->randomMachineName(16);
  $valid_configuration['signature_text'] = $this
    ->randomMachineName(512);
  return $valid_configuration;
}