public function TrustedHostsRequestFactoryTest::testCreateRequest in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php \Drupal\Tests\Core\Http\TrustedHostsRequestFactoryTest::testCreateRequest()
- 10 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 30
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());
}