public function testBuild() { $url = Url::parse('http://jwage.com')->set('port', '443')->set('scheme', 'https'); $url->query->set('param1', 'value1')->set('param2', 'value2'); $url->path->add('about'); $url->path->add('me'); $url->fragment->path->add('fragment1'); $url->fragment->path->add('fragment2'); $url->fragment->query->set('param1', 'value1')->set('param2', 'value2'); $this->assertEquals('https://jwage.com:443/about/me?param1=value1¶m2=value2#/fragment1/fragment2?param1=value1¶m2=value2', (string) $url); }
/** * Return the path portion of the URL * i.e. http://abc.foo.co.uk/this/path => this/path * * @return string */ public static function path($url) { return (string) Purl::parse($url)->path; }