Merge "Made upload jobs avoid using the user session"
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / CSSMinTest.php
index 2b4d60d..6fa3acf 100644 (file)
@@ -147,9 +147,12 @@ class CSSMinTest extends MediaWikiTestCase {
                // Full paths start with http://localhost/w/.
                // Timestamps in output are replaced with 'timestamp'.
 
-               // data: URIs for red.gif and green.gif
+               // data: URIs for red.gif, green.gif, circle.svg
                $red   = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs=';
                $green = 'data:image/gif;base64,R0lGODlhAQABAIAAAACAADAAACwAAAAAAQABAAACAkQBADs=';
+               $svg = 'data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A'
+                       . '%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D'
+                       . '%228%22%3E%0A%3Ccircle%20cx%3D%224%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%0A%3C%2Fsvg%3E%0A';
 
                return array(
                        array(
@@ -202,6 +205,11 @@ class CSSMinTest extends MediaWikiTestCase {
                                'foo { /* @embed */ background: url(red.gif); }',
                                "foo { background: url($red); background: url(http://localhost/w/red.gif?timestamp)!ie; }",
                        ),
+                       array(
+                               'Embedded file, other comments before the rule',
+                               "foo { /* Bar. */ /* @embed */ background: url(red.gif); }",
+                               "foo { /* Bar. */ background: url($red); /* Bar. */ background: url(http://localhost/w/red.gif?timestamp)!ie; }",
+                       ),
                        array(
                                'Can not re-embed data: URIs',
                                "foo { /* @embed */ background: url($red); }",
@@ -228,6 +236,11 @@ class CSSMinTest extends MediaWikiTestCase {
                                'foo { /* @embed */ background: url(large.png); }',
                                "foo { background: url(http://localhost/w/large.png?timestamp); }",
                        ),
+                       array(
+                               'SVG files are embedded without base64 encoding and unnecessary IE 6 and 7 fallback',
+                               'foo { /* @embed */ background: url(circle.svg); }',
+                               "foo { background: url($svg); }",
+                       ),
                        array(
                                'Two regular files in one rule',
                                'foo { background: url(red.gif), url(green.gif); }',