You are here

public function ResponseTest::testNewInstanceWhenAddingHeader in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/psr7/tests/ResponseTest.php \GuzzleHttp\Tests\Psr7\ResponseTest::testNewInstanceWhenAddingHeader()

File

vendor/guzzlehttp/psr7/tests/ResponseTest.php, line 115

Class

ResponseTest
@covers GuzzleHttp\Psr7\MessageTrait @covers GuzzleHttp\Psr7\Response

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testNewInstanceWhenAddingHeader() {
  $r = new Response(200, [
    'Foo' => 'Bar',
  ]);
  $r2 = $r
    ->withAddedHeader('Foo', 'Baz');
  $this
    ->assertNotSame($r, $r2);
  $this
    ->assertEquals('Bar, Baz', $r2
    ->getHeaderLine('foo'));
}