Convert all to new configuration get/set format.
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / HTMLModule / ScriptingTest.php
blobc844a477694fdc01b298759026a964fedbfdf19f
1 <?php
3 class HTMLPurifier_HTMLModule_ScriptingTest extends HTMLPurifier_HTMLModuleHarness
6 function setUp() {
7 parent::setUp();
8 $this->config->set('HTML.Trusted', true);
9 $this->config->set('Output.CommentScriptContents', false);
12 function testDefaultRemoval() {
13 $this->config->set('HTML.Trusted', false);
14 $this->assertResult(
15 '<script type="text/javascript">foo();</script>', ''
19 function testPreserve() {
20 $this->assertResult(
21 '<script type="text/javascript">foo();</script>'
25 function testCDATAEnclosure() {
26 $this->assertResult(
27 '<script type="text/javascript">//<![CDATA[
28 alert("<This is compatible with XHTML>");
29 //]]></script>'
33 function testAllAttributes() {
34 $this->assertResult(
35 '<script
36 defer="defer"
37 src="test.js"
38 type="text/javascript"
39 >PCDATA</script>'
43 function testUnsupportedAttributes() {
44 $this->assertResult(
45 '<script
46 type="text/javascript"
47 charset="utf-8"
48 >PCDATA</script>',
49 '<script type="text/javascript">PCDATA</script>'
55 // vim: et sw=4 sts=4