/**
* @dataProvider getGenerateRelativePathData
*/
public function testGenerateRelativePath($expected,
$path,
$pathinfo) { $stack =
new RequestStack();
$stack->
push(Request::
create($pathinfo));
$urlHelper =
new UrlHelper($stack);
$this->
assertEquals($expected,
$urlHelper->
getRelativePath($path));
} public static function getGenerateRelativePathData() { return [ ['../foo.png', '/foo.png', '/foo/bar.html'
],
['../baz/foo.png', '/baz/foo.png', '/foo/bar.html'
],
['baz/foo.png', 'baz/foo.png', '/foo/bar.html'
],
['http://example.com/baz', 'http://example.com/baz', '/'
],
['https://example.com/baz', 'https://example.com/baz', '/'
],
[