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.

37 lines
779B

  1. <?php
  2. class HTMLPurifier_HTMLModule_NameTest extends HTMLPurifier_HTMLModuleHarness
  3. {
  4. public function setUp()
  5. {
  6. parent::setUp();
  7. }
  8. public function testBasicUse()
  9. {
  10. $this->config->set('Attr.EnableID', true);
  11. $this->assertResult(
  12. '<a name="foo">bar</a>'
  13. );
  14. }
  15. public function testCDATA()
  16. {
  17. $this->config->set('HTML.Attr.Name.UseCDATA', true);
  18. $this->assertResult(
  19. '<a name="2">Baz</a><a name="2">Bar</a>'
  20. );
  21. }
  22. public function testCDATAWithHeavyTidy()
  23. {
  24. $this->config->set('HTML.Attr.Name.UseCDATA', true);
  25. $this->config->set('HTML.TidyLevel', 'heavy');
  26. $this->assertResult('<a name="2">Baz</a>');
  27. }
  28. }
  29. // vim: et sw=4 sts=4