/**
  * Factory method to build a URI from parts
  *
  * @param string $scheme
  * @param string $userInfo
  * @param string $host
  * @param string $port
  * @param string $path
  * @param string $query
  * @param string $fragment
  *
  * @return UriInterface
  */
 public function createFromParts($scheme, $userInfo, $host, $port, $path = '', $query = '', $fragment = '')
 {
     $uri = new Uri();
     $uri->setScheme($scheme);
     $uri->setUserInfo($userInfo);
     $uri->setHost($host);
     $uri->setPort($port);
     $uri->setPath($path);
     $uri->setQuery($query);
     $uri->setFragment($fragment);
     return $uri;
 }
Exemple #2
0
 /**
  * @covers OAuth\Common\Http\Uri\Uri::__construct
  * @covers OAuth\Common\Http\Uri\Uri::parseUri
  * @covers OAuth\Common\Http\Uri\Uri::setFragment
  * @covers OAuth\Common\Http\Uri\Uri::getAbsoluteUri
  */
 public function testSetFragmentWithData()
 {
     $uri = new Uri('http://example.com');
     $uri->setFragment('foo');
     $this->assertSame('http://example.com#foo', $uri->getAbsoluteUri());
 }