You are here

public function RequestTest::testHostIsNotOverwrittenWhenPreservingHost in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/tests/RequestTest.php \GuzzleHttp\Tests\Psr7\RequestTest::testHostIsNotOverwrittenWhenPreservingHost()

File

vendor/guzzlehttp/psr7/tests/RequestTest.php, line 120

Class

RequestTest
@covers GuzzleHttp\Psr7\Request

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testHostIsNotOverwrittenWhenPreservingHost() {
  $r = new Request('GET', 'http://foo.com/baz?bar=bam', [
    'Host' => 'a.com',
  ]);
  $this
    ->assertEquals([
    'Host' => [
      'a.com',
    ],
  ], $r
    ->getHeaders());
  $r2 = $r
    ->withUri(new Uri('http://www.foo.com/bar'), true);
  $this
    ->assertEquals('a.com', $r2
    ->getHeaderLine('Host'));
}