You are here

public function UriTest::testParsesProvidedUrl in Zircon Profile 8

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

File

vendor/guzzlehttp/psr7/tests/UriTest.php, line 13

Class

UriTest
@covers GuzzleHttp\Psr7\Uri

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testParsesProvidedUrl() {
  $uri = new Uri('https://michael:test@test.com:443/path/123?q=abc#test');

  // Standard port 443 for https gets ignored.
  $this
    ->assertEquals('https://michael:test@test.com/path/123?q=abc#test', (string) $uri);
  $this
    ->assertEquals('test', $uri
    ->getFragment());
  $this
    ->assertEquals('test.com', $uri
    ->getHost());
  $this
    ->assertEquals('/path/123', $uri
    ->getPath());
  $this
    ->assertEquals(null, $uri
    ->getPort());
  $this
    ->assertEquals('q=abc', $uri
    ->getQuery());
  $this
    ->assertEquals('https', $uri
    ->getScheme());
  $this
    ->assertEquals('michael:test', $uri
    ->getUserInfo());
}