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.

38 lines
749B

  1. <?php
  2. class HTMLPurifier_HTMLModule_SafeScriptingTest extends HTMLPurifier_HTMLModuleHarness
  3. {
  4. public function setUp()
  5. {
  6. parent::setUp();
  7. $this->config->set('HTML.SafeScripting', array('http://localhost/foo.js'));
  8. }
  9. public function testMinimal()
  10. {
  11. $this->assertResult(
  12. '<script></script>',
  13. ''
  14. );
  15. }
  16. public function testGood()
  17. {
  18. $this->assertResult(
  19. '<script type="text/javascript" src="http://localhost/foo.js" />'
  20. );
  21. }
  22. public function testBad()
  23. {
  24. $this->assertResult(
  25. '<script type="text/javascript" src="http://localhost/foobar.js" />',
  26. ''
  27. );
  28. }
  29. }
  30. // vim: et sw=4 sts=4