X-Git-Url: http://git.cyclocoop.org//%27http:/jquery.khurshid.com/ifixpng.php/%27?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flibs%2FCSSMinTest.php;h=354dae203bba66b7d4087ff181bc6249934d3d8b;hb=fd3f586dbbbb556aa19c0a53c7e8cb1aa93fa164;hp=46bf2c6c831ac82e71f806cdccc6d4f9a36476df;hpb=c9d8188f1ee27e8a816949bf6b74e340156aafc7;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 46bf2c6c83..354dae203b 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -35,7 +35,7 @@ class CSSMinTest extends MediaWikiTestCase { public static function provideSerializeStringValue() { return [ [ 'Hello World!', '"Hello World!"' ], - [ "Null\0Null", "\"Null\\fffd Null\"" ], + [ "Null\0Null", "\"Null\xEF\xBF\xBDNull\"" ], [ '"', '"\\""' ], [ "'", '"\'"' ], [ "\\", '"\\\\"' ], @@ -199,6 +199,9 @@ class CSSMinTest extends MediaWikiTestCase { [ true, '//example.org/x.y.z/image.png' ], [ true, '//localhost/styles.css?query=yes' ], [ true, 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs=' ], + [ false, '' ], + [ false, '/' ], + [ true, '//' ], [ false, 'x.gif' ], [ false, '/x.gif' ], [ false, './x.gif' ], @@ -217,6 +220,9 @@ class CSSMinTest extends MediaWikiTestCase { public static function provideIsLocalUrls() { return [ + [ false, '' ], + [ false, '/' ], + [ false, '//' ], [ false, 'x.gif' ], [ true, '/x.gif' ], [ false, './x.gif' ], @@ -316,6 +322,10 @@ class CSSMinTest extends MediaWikiTestCase { [ 'background-image: url("");', false, '/example', false ], 'background-image: url("");', ], + 'Single quote with outer spacing' => [ + [ "background-image: url( '' );", false, '/example', false ], + "background-image: url( '' );", + ], ]; } @@ -390,6 +400,11 @@ class CSSMinTest extends MediaWikiTestCase { 'foo { background: url(/static/foo.png?query=yes); }', 'foo { background: url(https://expand.example/static/foo.png?query=yes); }', ], + [ + 'Path-relative URL with query', + "foo { background: url(?query=yes); }", + 'foo { background: url(http://localhost/w/?query=yes); }', + ], [ 'Remote URL (unnecessary quotes not preserved)', 'foo { background: url("http://example.org/w/unnecessary-quotes.png"); }', @@ -534,6 +549,11 @@ class CSSMinTest extends MediaWikiTestCase { 'foo { background: url( "http://localhost/styles.css?quoted=double" ) }', 'foo { background: url(http://localhost/styles.css?quoted=double) }', ], + [ + 'Background URL (single quoted, containing spaces, with outer spacing)', + "foo { background: url( ' red.gif ' ); }", + 'foo { background: url("http://localhost/w/ red.gif "); }', + ], [ 'Simple case with comments before url', 'foo { prop: /* some {funny;} comment */ url(bar.png); }',