You are here

public function FunctionsTest::testParsesRequestMessagesWithUriWhenHostIsNotFirst in Zircon Profile 8

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

File

vendor/guzzlehttp/psr7/tests/FunctionsTest.php, line 264

Class

FunctionsTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testParsesRequestMessagesWithUriWhenHostIsNotFirst() {
  $req = "PUT / HTTP/1.1\r\nFoo: Bar\r\nHost: foo.com\r\n\r\n";
  $request = Psr7\parse_request($req);
  $this
    ->assertEquals('PUT', $request
    ->getMethod());
  $this
    ->assertEquals('/', $request
    ->getRequestTarget());
  $this
    ->assertEquals('http://foo.com/', (string) $request
    ->getUri());
}