You are here

protected function SecuritytxtBaseTest::submitValidConfiguration in Security.txt 8

Submit a valid configuration to both the 'Configure' and 'Sign' forms.

Return value

array An array of valid configuration values.

2 calls to SecuritytxtBaseTest::submitValidConfiguration()
SecuritytxtFormTest::testValidConfigurationSubmission in tests/src/Functional/SecuritytxtFormTest.php
Test valid configuration submission.
SecuritytxtPermissionsTest::testEnabledAccess in tests/src/Functional/SecuritytxtPermissionsTest.php
Test permissions to all Security.txt paths when Security.txt is enabled.

File

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

Class

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

Namespace

Drupal\Tests\securitytxt\Functional

Code

protected function submitValidConfiguration() {
  $this
    ->drupalLogin($this->administerPermissionUser);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $valid_configuration = $this
    ->getValidConfiguration();
  $configure_edit = $valid_configuration;
  unset($configure_edit['signature_text']);
  $this
    ->submitConfigureForm($configure_edit);
  $sign_edit['signature_text'] = $valid_configuration['signature_text'];
  $this
    ->submitSignForm($sign_edit);
  $this
    ->drupalLogout();
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  return $valid_configuration;
}