@@ -33,21 +33,28 @@ public function getConfigs()
33
33
array ('http://example.net ' , '' , 'http://example.com/foo ' , 'http://example.com/foo ' ),
34
34
array ('http://example.net ' , '' , 'https://example.com/foo ' , 'https://example.com/foo ' ),
35
35
array ('http://example.net ' , '' , '//example.com/foo ' , '//example.com/foo ' ),
36
+ array ('file:///example/net ' , '' , 'file:///example/com/foo ' , 'file:///example/com/foo ' ),
37
+ array ('ftp://example.net ' , '' , 'ftp://example.com ' , 'ftp://example.com ' ),
36
38
37
39
array ('http://example.com ' , '' , '/foo ' , 'http://example.com/foo?v1 ' ),
38
40
array ('http://example.com ' , '' , 'foo ' , 'http://example.com/foo?v1 ' ),
39
41
array ('http://example.com/ ' , '' , 'foo ' , 'http://example.com/foo?v1 ' ),
40
42
array ('http://example.com/foo ' , '' , 'foo ' , 'http://example.com/foo/foo?v1 ' ),
41
43
array ('http://example.com/foo/ ' , '' , 'foo ' , 'http://example.com/foo/foo?v1 ' ),
44
+ array ('file:///example/com/foo/ ' , '' , 'foo ' , 'file:///example/com/foo/foo?v1 ' ),
42
45
43
46
array (array ('http://example.com ' ), '' , '/foo ' , 'http://example.com/foo?v1 ' ),
44
47
array (array ('http://example.com ' , 'http://example.net ' ), '' , '/foo ' , 'http://example.com/foo?v1 ' ),
45
48
array (array ('http://example.com ' , 'http://example.net ' ), '' , '/fooa ' , 'http://example.net/fooa?v1 ' ),
49
+ array (array ('file:///example/com ' , 'file:///example/net ' ), '' , '/foo ' , 'file:///example/com/foo?v1 ' ),
50
+ array (array ('ftp://example.com ' , 'ftp://example.net ' ), '' , '/fooa ' , 'ftp://example.net/fooa?v1 ' ),
46
51
47
52
array ('http://example.com ' , 'version-%2$s/%1$s ' , '/foo ' , 'http://example.com/version-v1/foo ' ),
48
53
array ('http://example.com ' , 'version-%2$s/%1$s ' , 'foo ' , 'http://example.com/version-v1/foo ' ),
49
54
array ('http://example.com ' , 'version-%2$s/%1$s ' , 'foo/ ' , 'http://example.com/version-v1/foo/ ' ),
50
55
array ('http://example.com ' , 'version-%2$s/%1$s ' , '/foo/ ' , 'http://example.com/version-v1/foo/ ' ),
56
+ array ('file:///example/com ' , 'version-%2$s/%1$s ' , '/foo/ ' , 'file:///example/com/version-v1/foo/ ' ),
57
+ array ('ftp://example.com ' , 'version-%2$s/%1$s ' , '/foo/ ' , 'ftp://example.com/version-v1/foo/ ' ),
51
58
);
52
59
}
53
60
@@ -97,11 +104,21 @@ public function testNoBaseUrls()
97
104
}
98
105
99
106
/**
107
+ * @dataProvider getWrongBaseUrlConfig
108
+ *
100
109
* @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException
101
110
*/
102
- public function testWrongBaseUrl ()
111
+ public function testWrongBaseUrl ($ baseUrls )
103
112
{
104
- new UrlPackage (array ('not-a-url ' ), new EmptyVersionStrategy ());
113
+ new UrlPackage ($ baseUrls , new EmptyVersionStrategy ());
114
+ }
115
+
116
+ public function getWrongBaseUrlConfig ()
117
+ {
118
+ return array (
119
+ array ('not-a-url ' ),
120
+ array ('not-a-url-with-query?query=:// ' )
121
+ );
105
122
}
106
123
107
124
private function getContext ($ secure )
0 commit comments