@@ 14-21 (lines=8) @@ | ||
11 | * @dataProvider configProvider |
|
12 | * @param array $config |
|
13 | */ |
|
14 | public function testGenerateUrl(array $config) |
|
15 | { |
|
16 | $urlGenerator = new CanonicalUrlGenerator($this->getRouter(), $config); |
|
17 | ||
18 | $url = $urlGenerator->generate('foo'); |
|
19 | ||
20 | $this->assertEquals('https://example.org/foo', $url); |
|
21 | } |
|
22 | ||
23 | /** |
|
24 | * @dataProvider configProvider |
|
@@ 27-34 (lines=8) @@ | ||
24 | * @dataProvider configProvider |
|
25 | * @param array $config |
|
26 | */ |
|
27 | public function testGenerateUrlWithStringParams(array $config) |
|
28 | { |
|
29 | $urlGenerator = new CanonicalUrlGenerator($this->getRouter(), $config); |
|
30 | ||
31 | $url = $urlGenerator->generate('foo', 'key1=val1&key2=val2'); |
|
32 | ||
33 | $this->assertEquals('https://example.org/foo?key1=val1&key2=val2', $url); |
|
34 | } |
|
35 | ||
36 | /** |
|
37 | * @dataProvider configProvider |
|
@@ 52-59 (lines=8) @@ | ||
49 | * @dataProvider configProvider |
|
50 | * @param array $config |
|
51 | */ |
|
52 | public function testEmptyRouteReturnsEmptyString(array $config) |
|
53 | { |
|
54 | $urlGenerator = new CanonicalUrlGenerator($this->getRouter(), $config); |
|
55 | ||
56 | $url = $urlGenerator->generate(''); |
|
57 | ||
58 | $this->assertSame('', $url); |
|
59 | } |
|
60 | } |
|
61 |