aboutsummaryrefslogtreecommitdiffstats
path: root/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-12 17:57:41 -0700
committerfriendica <info@friendica.com>2012-07-18 20:40:31 +1000
commit7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (patch)
treea9c3d91209cff770bb4b613b1b95e61a7bbc5a2b /lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php
parentcd727cb26b78a1dade09d510b071446898477356 (diff)
downloadvolse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.gz
volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.bz2
volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.zip
some important stuff we'll need
Diffstat (limited to 'lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php')
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php
new file mode 100644
index 000000000..a216b2677
--- /dev/null
+++ b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php
@@ -0,0 +1,68 @@
+<?php
+
+class HTMLPurifier_AttrDef_CSS_BackgroundPositionTest extends HTMLPurifier_AttrDefHarness
+{
+
+ function test() {
+
+ $this->def = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
+
+ // explicitly cited in spec
+ $this->assertDef('0% 0%');
+ $this->assertDef('100% 100%');
+ $this->assertDef('14% 84%');
+ $this->assertDef('2cm 1cm');
+ $this->assertDef('top');
+ $this->assertDef('left');
+ $this->assertDef('center');
+ $this->assertDef('right');
+ $this->assertDef('bottom');
+ $this->assertDef('left top');
+ $this->assertDef('center top');
+ $this->assertDef('right top');
+ $this->assertDef('left center');
+ $this->assertDef('right center');
+ $this->assertDef('left bottom');
+ $this->assertDef('center bottom');
+ $this->assertDef('right bottom');
+
+ // reordered due to internal impl details
+ $this->assertDef('top left', 'left top');
+ $this->assertDef('top center', 'top');
+ $this->assertDef('top right', 'right top');
+ $this->assertDef('center left', 'left');
+ $this->assertDef('center center', 'center');
+ $this->assertDef('center right', 'right');
+ $this->assertDef('bottom left', 'left bottom');
+ $this->assertDef('bottom center', 'bottom');
+ $this->assertDef('bottom right', 'right bottom');
+
+ // more cases from the defined syntax
+ $this->assertDef('1.32in 4ex');
+ $this->assertDef('-14% -84.65%');
+ $this->assertDef('-1in -4ex');
+ $this->assertDef('-1pc 2.3%');
+
+ // keyword mixing
+ $this->assertDef('3em top');
+ $this->assertDef('left 50%');
+
+ // fixable keyword mixing
+ $this->assertDef('top 3em', '3em top');
+ $this->assertDef('50% left', 'left 50%');
+
+ // whitespace collapsing
+ $this->assertDef('3em top', '3em top');
+ $this->assertDef("left\n \t foo ", 'left');
+
+ // invalid uses (we're going to be strict on these)
+ $this->assertDef('foo bar', false);
+ $this->assertDef('left left', 'left');
+ $this->assertDef('left right top bottom center left', 'left bottom');
+ $this->assertDef('0fr 9%', '9%');
+
+ }
+
+}
+
+// vim: et sw=4 sts=4