'abc', 'bla' => 'foo'], 'http://f.b/foo?test=abc&bla=foo'], ]; } /** * @dataProvider provideLinksTo * @covers \Engelsystem\Http\UrlGenerator::to * * @param string $path * @param string $willReturn * @param string $urlToPath * @param string[] $arguments * @param string $expectedUrl */ public function testTo($urlToPath, $path, $willReturn, $arguments, $expectedUrl) { $app = new Container(); $urlGenerator = new UrlGenerator(); Application::setInstance($app); $request = $this->getMockBuilder(Request::class) ->getMock(); $request->expects($this->once()) ->method('getUriForPath') ->with($path) ->willReturn($willReturn); $app->instance('request', $request); $url = $urlGenerator->to($urlToPath, $arguments); $this->assertEquals($expectedUrl, $url); } }