MultipleTest.php 687 B

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