public function TrustedHostsRequestFactoryTest::testCreateRequest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php \Drupal\Tests\Core\Http\TrustedHostsRequestFactoryTest::testCreateRequest()
Tests TrustedHostsRequestFactory::createRequest().
@covers ::createRequest @dataProvider providerTestCreateRequest
Parameters
string $host: The host to pass into TrustedHostsRequestFactory.
array $server: The server array to pass into TrustedHostsRequestFactory::createRequest().
string $expected: The expected host of the created request.
File
- core/
tests/ Drupal/ Tests/ Core/ Http/ TrustedHostsRequestFactoryTest.php, line 34 - Contains \Drupal\Tests\Core\Http\TrustedHostsRequestFactoryTest.
Class
- TrustedHostsRequestFactoryTest
- Tests the trusted hosts request factory.
Namespace
Drupal\Tests\Core\HttpCode
public function testCreateRequest($host, $server, $expected) {
$request_factory = new TrustedHostsRequestFactory($host);
$request = $request_factory
->createRequest([], [], [], [], [], $server, []);
$this
->assertEquals($expected, $request
->getHost());
}