public function ResponseTest::testNewInstanceWhenAddingHeaderThatWasNotThereBefore in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/psr7/tests/ResponseTest.php \GuzzleHttp\Tests\Psr7\ResponseTest::testNewInstanceWhenAddingHeaderThatWasNotThereBefore()
File
- vendor/
guzzlehttp/ psr7/ tests/ ResponseTest.php, line 123
Class
- ResponseTest
- @covers GuzzleHttp\Psr7\MessageTrait @covers GuzzleHttp\Psr7\Response
Namespace
GuzzleHttp\Tests\Psr7Code
public function testNewInstanceWhenAddingHeaderThatWasNotThereBefore() {
$r = new Response(200, [
'Foo' => 'Bar',
]);
$r2 = $r
->withAddedHeader('Baz', 'Bam');
$this
->assertNotSame($r, $r2);
$this
->assertEquals('Bam', $r2
->getHeaderLine('Baz'));
$this
->assertEquals('Bar', $r2
->getHeaderLine('Foo'));
}