AttrDefTest.php 775 B

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