public function ValidateHostnameTest::testValidateHostname in Drupal 8
Same name and namespace in other branches
- 9 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);
}