You are here

public function FunctionsTest::testParsesRequestMessagesWithFullUri in Zircon Profile 8

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

File

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

Class

FunctionsTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testParsesRequestMessagesWithFullUri() {
  $req = "GET https://www.google.com:443/search?q=foobar HTTP/1.1\r\nHost: www.google.com\r\n\r\n";
  $request = Psr7\parse_request($req);
  $this
    ->assertEquals('GET', $request
    ->getMethod());
  $this
    ->assertEquals('https://www.google.com:443/search?q=foobar', $request
    ->getRequestTarget());
  $this
    ->assertEquals('1.1', $request
    ->getProtocolVersion());
  $this
    ->assertEquals('www.google.com', $request
    ->getHeaderLine('Host'));
  $this
    ->assertEquals('', (string) $request
    ->getBody());
  $this
    ->assertEquals('https://www.google.com/search?q=foobar', (string) $request
    ->getUri());
}