public function getHostRelativeUrl() { $url = $this->getPath(); if ($this->hasQueryString()) { $url .= '?' . $this->getQueryString(); } if ($this->hasFragmentString()) { $url .= '#' . $this->getFragmentString(); } return $url; }
public function testBriefHttpUrlUsage() { $url = new Http\Url('http://example.org/'); $this->assertEquals($url->getHostRelativeUrl(), '/'); $this->assertEquals($url->getSchemeRelativeUrl(), '//example.org/'); }