public function testRelativizeUri($base, $expectedRelativeReference, $target)
{
$baseUri = new Uri($base);
$relativeUri = UriResolver::relativize($baseUri, new Uri($target));
$this->assertInstanceOf('Psr\\Http\\Message\\UriInterface', $relativeUri);
// There are test-cases with too many dot-segments and relative references that are equal like "." == "./".
// So apart from the same-as condition, this alternative success condition is necessary.
$this->assertTrue($expectedRelativeReference === (string) $relativeUri || $target === (string) UriResolver::resolve($baseUri, $relativeUri), sprintf('"%s" is not the correct relative reference as it does not resolve to the target URI from the base URI', (string) $relativeUri));
}