class ValidateHostnameTest extends UnitTestCase
{ /**
* @covers ::validateHostname
* @dataProvider providerTestValidateHostname
*/
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);
} /**
* Provides test data for testValidateHostname().
*/
public function providerTestValidateHostname() { $data =
[];
// Verifies that DrupalKernel::validateHostname() prevents invalid
// characters per RFC 952/2181.