function ValidateHostnameTest::testValidateHostname
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php \Drupal\Tests\Core\DrupalKernel\ValidateHostnameTest::testValidateHostname()
- 8.9.x core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php \Drupal\Tests\Core\DrupalKernel\ValidateHostnameTest::testValidateHostname()
- 10 core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php \Drupal\Tests\Core\DrupalKernel\ValidateHostnameTest::testValidateHostname()
@covers ::validateHostname @dataProvider providerTestValidateHostname
File
-
core/
tests/ Drupal/ Tests/ Core/ DrupalKernel/ ValidateHostnameTest.php, line 21
Class
- ValidateHostnameTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21DrupalKernel.php/class/DrupalKernel/11.x" title="The DrupalKernel class is the core of Drupal itself." class="local">\Drupal\Core\DrupalKernel</a> @group DrupalKernel
Namespace
Drupal\Tests\Core\DrupalKernelCode
public function testValidateHostname($hostname, $message, $expected = FALSE) : void {
$server = [
'HTTP_HOST' => $hostname,
];
$request = new Request([], [], [], [], [], $server);
$validated_hostname = DrupalKernel::validateHostname($request);
$this->assertSame($expected, $validated_hostname, $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.