Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function testSanitizerRemovesScriptTagsFromAHtmlString() |
||
19 | { |
||
20 | $helper = new SanitizerHelper(); |
||
21 | $html = '<!DOCTYPE html><html><head></head><body><h1>This is my test page</h1><script>alert(\'hello\');</script></body></html>'; |
||
22 | |||
23 | $output = $helper->sanitize($html); |
||
24 | |||
25 | $this->assertRegExp('/script/', $html, 'HTML string given does regexp match script tag.'); |
||
26 | $this->assertNotRegExp('/script/', $output, 'Output should not match script tags.'); |
||
27 | } |
||
28 | } |