You are here

public function RequestTest::testOverridesHostWithUri in Zircon Profile 8

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

File

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

Class

RequestTest
@covers GuzzleHttp\Psr7\Request

Namespace

GuzzleHttp\Tests\Psr7

Code

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