public function DrupalKernelTest::providerTestTrustedHosts in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\DrupalKernelTest::providerTestTrustedHosts()
Provides test data for testTrustedHosts().
File
- core/
tests/ Drupal/ Tests/ Core/ DrupalKernel/ DrupalKernelTest.php, line 58 - Contains \Drupal\Tests\Core\DrupalKernel\DrupalKernelTest.
Class
- DrupalKernelTest
- @coversDefaultClass \Drupal\Core\DrupalKernel @group DrupalKernel
Namespace
Drupal\Tests\Core\DrupalKernelCode
public function providerTestTrustedHosts() {
$data = [];
// Tests canonical URL.
$data[] = [
'www.example.com',
'www.example.com',
'canonical URL is trusted',
TRUE,
];
// Tests missing hostname for HTTP/1.0 compatibility where the Host
// header is optional.
$data[] = [
NULL,
'www.example.com',
'empty Host is valid',
TRUE,
];
// Tests the additional patterns from the settings.
$data[] = [
'example.com',
'www.example.com',
'host from settings is trusted',
TRUE,
];
$data[] = [
'subdomain.example.com',
'www.example.com',
'host from settings is trusted',
TRUE,
];
$data[] = [
'www.example.org',
'www.example.com',
'host from settings is trusted',
TRUE,
];
$data[] = [
'example.org',
'www.example.com',
'host from settings is trusted',
TRUE,
];
// Tests mismatch.
$data[] = [
'www.blackhat.com',
'www.example.com',
'unspecified host is untrusted',
FALSE,
];
return $data;
}