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.

DisplayLinkURITest.php 835B

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