You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LengthTest.php 672B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. class HTMLPurifier_AttrDef_HTML_LengthTest extends HTMLPurifier_AttrDef_HTML_PixelsTest
  3. {
  4. public function setup()
  5. {
  6. $this->def = new HTMLPurifier_AttrDef_HTML_Length();
  7. }
  8. public function test()
  9. {
  10. // pixel check
  11. parent::test();
  12. // percent check
  13. $this->assertDef('25%');
  14. // Firefox maintains percent, so will we
  15. $this->assertDef('0%');
  16. // 0% <= percent <= 100%
  17. $this->assertDef('-15%', '0%');
  18. $this->assertDef('120%', '100%');
  19. // fractional percents, apparently, aren't allowed
  20. $this->assertDef('56.5%', '56%');
  21. }
  22. }
  23. // vim: et sw=4 sts=4