function TrustedHostsTest::testStatusPageWithConfiguration
Same name in other branches
- 9 core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithConfiguration()
- 8.9.x core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithConfiguration()
- 11.x core/modules/system/tests/src/Functional/System/TrustedHostsTest.php \Drupal\Tests\system\Functional\System\TrustedHostsTest::testStatusPageWithConfiguration()
Tests that the status page shows the trusted patterns from settings.php.
File
-
core/
modules/ system/ tests/ src/ Functional/ System/ TrustedHostsTest.php, line 50
Class
- TrustedHostsTest
- Tests output on the status overview page.
Namespace
Drupal\Tests\system\Functional\SystemCode
public function testStatusPageWithConfiguration() : void {
$settings['settings']['trusted_host_patterns'] = (object) [
'value' => [
'^' . preg_quote(\Drupal::request()->getHost()) . '$',
],
'required' => TRUE,
];
$this->writeSettings($settings);
$this->drupalGet('admin/reports/status');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->pageTextContains("Trusted Host Settings");
$this->assertSession()
->pageTextContains("The trusted_host_patterns setting is set to allow");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.