function TrustedHostsTest::testStatusPageWithoutConfiguration

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithoutConfiguration()
  2. 10 core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithoutConfiguration()
  3. 11.x core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithoutConfiguration()

Tests that the status page shows an error when the trusted host setting is missing from settings.php

File

core/modules/system/tests/src/Functional/System/TrustedHostsTest.php, line 35

Class

TrustedHostsTest
Tests output on the status overview page.

Namespace

Drupal\Tests\system\Functional\System

Code

public function testStatusPageWithoutConfiguration() {
    $this->drupalGet('admin/reports/status');
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->assertRaw(t('Trusted Host Settings'));
    $this->assertRaw(t('The trusted_host_patterns setting is not configured in settings.php.'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.