You are here

public function TrustedHostsTest::testStatusPageWithConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/System/TrustedHostsTest.php \Drupal\system\Tests\System\TrustedHostsTest::testStatusPageWithConfiguration()

Tests that the status page shows the trusted patterns from settings.php.

File

core/modules/system/src/Tests/System/TrustedHostsTest.php, line 46
Contains \Drupal\system\Tests\System\TrustedHostsTest.

Class

TrustedHostsTest
Tests output on the status overview page.

Namespace

Drupal\system\Tests\System

Code

public function testStatusPageWithConfiguration() {
  $settings['settings']['trusted_host_patterns'] = (object) array(
    'value' => array(
      '^' . preg_quote(\Drupal::request()
        ->getHost()) . '$',
    ),
    'required' => TRUE,
  );
  $this
    ->writeSettings($settings);
  $this
    ->drupalGet('admin/reports/status');
  $this
    ->assertResponse(200, 'The status page is reachable.');
  $this
    ->assertRaw(t('Trusted Host Settings'));
  $this
    ->assertRaw(t('The trusted_host_patterns setting is set to allow'));
}