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.

29 lines
584B

  1. <?php
  2. class HTMLPurifier_AttrDef_CSS_AlphaValueTest extends HTMLPurifier_AttrDefHarness
  3. {
  4. public function test()
  5. {
  6. $this->def = new HTMLPurifier_AttrDef_CSS_AlphaValue();
  7. $this->assertDef('0');
  8. $this->assertDef('1');
  9. $this->assertDef('.2');
  10. // clamping to [0.0, 1,0]
  11. $this->assertDef('1.2', '1');
  12. $this->assertDef('-3', '0');
  13. $this->assertDef('0.0', '0');
  14. $this->assertDef('1.0', '1');
  15. $this->assertDef('000', '0');
  16. $this->assertDef('asdf', false);
  17. }
  18. }
  19. // vim: et sw=4 sts=4