NameTest.php 735 B

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