summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2013-10-15 11:35:26 +0200
committerAndreas Gohr <gohr@cosmocode.de>2013-10-15 11:35:26 +0200
commita467e020fa551217347181ffd6915c7d29e6ff59 (patch)
treeb5539b5ec04c69c9e972553b1f3878f7c41b40d3 /_test
parent205907a73eaf15c53de98f153e90890706e79cbe (diff)
downloadrpg-a467e020fa551217347181ffd6915c7d29e6ff59.tar.gz
rpg-a467e020fa551217347181ffd6915c7d29e6ff59.tar.bz2
Added unit tests for CSS shorthand compression FS#2509
Diffstat (limited to '_test')
-rw-r--r--_test/tests/lib/exe/css_css_compress.test.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/_test/tests/lib/exe/css_css_compress.test.php b/_test/tests/lib/exe/css_css_compress.test.php
index a7c87b6a7..a614ea2fd 100644
--- a/_test/tests/lib/exe/css_css_compress.test.php
+++ b/_test/tests/lib/exe/css_css_compress.test.php
@@ -62,6 +62,46 @@ class css_css_compress_test extends DokuWikiTest {
$this->assertEquals(css_compress($text), 'a{left:20px;top:20px}');
}
+ function test_shortening() {
+ $input = array(
+ 'margin:0em 0em 0em 0em ul.test margin:0em :0em div#FFFFFF {',
+ 'margin: 1px 1px 1px 1px;',
+ 'padding: 1px 2px 1px 2px;',
+ 'margin: 1px 2px 3px 1px;',
+ 'padding: 1px 2px 3px 4px;',
+ 'margin: 00.00em 0em 01.00px 0em;',
+ 'padding: 0010em 0010.00em 00.00em 00.00100em;',
+ 'padding: 0010% 0010.00% 00.00% 00.00100xxx;',
+ 'padding: 0.0em .0em 0.em 00.00em;',
+ 'padding: 01.0em;',
+ 'color: #FFFFFF;',
+ 'color: #777777;',
+ 'color: #123456;',
+ 'border: 01.0em solid #ffffff;',
+ );
+
+ $expected = array(
+ 'margin:0em 0em 0em 0em ul.test margin:0em :0em div#FFFFFF{',
+ 'margin:1px;',
+ 'padding:1px 2px;',
+ 'margin:1px 2px 3px 1px;',
+ 'padding:1px 2px 3px 4px;',
+ 'margin:0 0 1px 0;',
+ 'padding:10em 10em 0 .001em;',
+ 'padding:10% 10% 0 00.00100xxx;',
+ 'padding:0;',
+ 'padding:1em;',
+ 'color:#FFF;',
+ 'color:#777;',
+ 'color:#123456;',
+ 'border:1em solid #fff;',
+ );
+
+ $input = array_map('css_compress', $input);
+
+ $this->assertEquals($expected, $input);
+ }
+
}
//Setup VIM: ex: et ts=4 :