From: Thiemo Kreuz Date: Wed, 2 May 2018 10:30:01 +0000 (+0200) Subject: CSSMin: Add more edge cases with spaces to CSSMinTest X-Git-Tag: 1.34.0-rc.0~5554^2 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=49216d9c3ba46cc2d63dec56d8c6b9d61a3e1394;p=lhc%2Fweb%2Fwiklou.git CSSMin: Add more edge cases with spaces to CSSMinTest Change-Id: Id5e884711ab69615273dd050d83c65a385aaa817 --- diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 46bf2c6c83..dabf66b320 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -316,6 +316,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 +394,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 +543,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); }',