Support for safe external scripts via explicit whitelist.
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / SafeScriptingTest.php
blob98b6212fe60e53a180aa8eb6c0335d97a44d7d2e
1 <?php
3 class HTMLPurifier_HTMLModule_SafeScriptingTest extends HTMLPurifier_HTMLModuleHarness
6 function setUp() {
7 parent::setUp();
8 $this->config->set('HTML.SafeScripting', array('http://localhost/foo.js'));
11 function testMinimal() {
12 $this->assertResult(
13 '<script></script>',
18 function testGood() {
19 $this->assertResult(
20 '<script type="text/javascript" src="http://localhost/foo.js" />'
24 function testBad() {
25 $this->assertResult(
26 '<script type="text/javascript" src="http://localhost/foobar.js" />',
33 // vim: et sw=4 sts=4