You are here

public function ResponseTest::testCanCreateNewResponseWithStatusAndNoReason in Zircon Profile 8

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

File

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

Class

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

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCanCreateNewResponseWithStatusAndNoReason() {
  $r = new Response(200);
  $r2 = $r
    ->withStatus(201);
  $this
    ->assertEquals(200, $r
    ->getStatusCode());
  $this
    ->assertEquals('OK', $r
    ->getReasonPhrase());
  $this
    ->assertEquals(201, $r2
    ->getStatusCode());
  $this
    ->assertEquals('Created', $r2
    ->getReasonPhrase());
}