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.

AttrDefTest.php 795B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. Mock::generatePartial(
  3. 'HTMLPurifier_AttrDef',
  4. 'HTMLPurifier_AttrDefTestable',
  5. array('validate'));
  6. class HTMLPurifier_AttrDefTest extends HTMLPurifier_Harness
  7. {
  8. public function test_parseCDATA()
  9. {
  10. $def = new HTMLPurifier_AttrDefTestable();
  11. $this->assertIdentical('', $def->parseCDATA(''));
  12. $this->assertIdentical('', $def->parseCDATA("\t\n\r \t\t"));
  13. $this->assertIdentical('foo', $def->parseCDATA("\t\n\r foo\t\t"));
  14. $this->assertIdentical('translate to space', $def->parseCDATA("translate\nto\tspace"));
  15. }
  16. public function test_make()
  17. {
  18. $def = new HTMLPurifier_AttrDefTestable();
  19. $def2 = $def->make('');
  20. $this->assertIdentical($def, $def2);
  21. }
  22. }
  23. // vim: et sw=4 sts=4