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.

30 lines
698B

  1. <?php
  2. // borrowed for the sakes of this test
  3. class HTMLPurifier_AttrDef_CSS_MultipleTest extends HTMLPurifier_AttrDefHarness
  4. {
  5. public function test()
  6. {
  7. $this->def = new HTMLPurifier_AttrDef_CSS_Multiple(
  8. new HTMLPurifier_AttrDef_Integer()
  9. );
  10. $this->assertDef('1 2 3 4');
  11. $this->assertDef('6');
  12. $this->assertDef('4 5');
  13. $this->assertDef(' 2 54 2 3', '2 54 2 3');
  14. $this->assertDef("6\r3", '6 3');
  15. $this->assertDef('asdf', false);
  16. $this->assertDef('a s d f', false);
  17. $this->assertDef('1 2 3 4 5', '1 2 3 4');
  18. $this->assertDef('1 2 invalid 3', '1 2 3');
  19. }
  20. }
  21. // vim: et sw=4 sts=4