function ValidateHostnameTest::testValidateHostname
Same name in other branches
- 9 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()
- 11.x 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 19
Class
- ValidateHostnameTest
- @coversDefaultClass \Drupal\Core\DrupalKernel @group DrupalKernel
Namespace
Drupal\Tests\Core\DrupalKernelCode
public function testValidateHostname($hostname, $message, $expected = FALSE) {
$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.