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.

NmtokensTest.php 833B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. class HTMLPurifier_AttrDef_HTML_NmtokensTest extends HTMLPurifier_AttrDefHarness
  3. {
  4. public function setUp()
  5. {
  6. parent::setUp();
  7. $this->def = new HTMLPurifier_AttrDef_HTML_Nmtokens();
  8. }
  9. public function testDefault()
  10. {
  11. $this->assertDef('valid');
  12. $this->assertDef('a0-_');
  13. $this->assertDef('-valid');
  14. $this->assertDef('_valid');
  15. $this->assertDef('double valid');
  16. $this->assertDef('0invalid', false);
  17. $this->assertDef('-0', false);
  18. // test conditional replacement
  19. $this->assertDef('validassoc 0invalid', 'validassoc');
  20. // test whitespace leniency
  21. $this->assertDef(" double\nvalid\r", 'double valid');
  22. // test case sensitivity
  23. $this->assertDef('VALID');
  24. }
  25. }
  26. // vim: et sw=4 sts=4