Commit 5aad69ed authored by freek's avatar freek
Browse files

remove ending slashes

parent b309b06a
......@@ -316,7 +316,7 @@ class Url implements UriInterface
$url .= '#'.$this->getFragment();
}
return $url;
return rtrim($url, '/');
}
public function __clone()
......
......@@ -25,6 +25,14 @@ class UrlBuildTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('https://spatie.be', $url->__toString());
}
/** @test */
public function it_can_convert_itself_back_to_a_string()
{
$url = Url::fromString('https://spatie.be/');
$this->assertEquals('https://spatie.be', $url->__toString());
}
/** @test */
public function it_throws_an_exception_when_providing_an_invalid_url_scheme()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment