You are here

public function UriTest::testAddAndRemoveQueryValues in Zircon Profile 8

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

File

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

Class

UriTest
@covers GuzzleHttp\Psr7\Uri

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testAddAndRemoveQueryValues() {
  $uri = new Uri('http://foo.com/bar');
  $uri = Uri::withQueryValue($uri, 'a', 'b');
  $uri = Uri::withQueryValue($uri, 'c', 'd');
  $uri = Uri::withQueryValue($uri, 'e', null);
  $this
    ->assertEquals('a=b&c=d&e', $uri
    ->getQuery());
  $uri = Uri::withoutQueryValue($uri, 'c');
  $uri = Uri::withoutQueryValue($uri, 'e');
  $this
    ->assertEquals('a=b', $uri
    ->getQuery());
  $uri = Uri::withoutQueryValue($uri, 'a');
  $uri = Uri::withoutQueryValue($uri, 'a');
  $this
    ->assertEquals('', $uri
    ->getQuery());
}