DisplayLinkURITest.php 791 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. class HTMLPurifier_Injector_DisplayLinkURITest extends HTMLPurifier_InjectorHarness
  3. {
  4. function setup() {
  5. parent::setup();
  6. $this->config->set('AutoFormat.DisplayLinkURI', true);
  7. }
  8. function testBasicLink() {
  9. $this->assertResult(
  10. '<a href="http://malware.example.com">Don\'t go here!</a>',
  11. '<a>Don\'t go here!</a> (http://malware.example.com)'
  12. );
  13. }
  14. function testEmptyLink() {
  15. $this->assertResult(
  16. '<a>Don\'t go here!</a>',
  17. '<a>Don\'t go here!</a>'
  18. );
  19. }
  20. function testEmptyText() {
  21. $this->assertResult(
  22. '<a href="http://malware.example.com"></a>',
  23. '<a></a> (http://malware.example.com)'
  24. );
  25. }
  26. }
  27. // vim: et sw=4 sts=4