Split testP() tests into multiple methods.
This commit is contained in:
parent
0d3ddd9e11
commit
88778b569e
1 changed files with 3 additions and 1 deletions
|
@ -27,13 +27,15 @@ class Test_TemplateFunctions extends PHPUnit_Framework_TestCase {
|
|||
$loader->load('OC_Template');
|
||||
}
|
||||
|
||||
public function testP() {
|
||||
public function testPJavaScript() {
|
||||
$badString = '<img onload="alert(1)" />';
|
||||
ob_start();
|
||||
p($badString);
|
||||
$result = ob_get_clean();
|
||||
$this->assertEquals('<img onload="alert(1)" />', $result);
|
||||
}
|
||||
|
||||
public function testPJavaScriptWithScriptTags() {
|
||||
$badString = "<script>alert('Hacked!');</script>";
|
||||
ob_start();
|
||||
p($badString);
|
||||
|
|
Loading…
Reference in a new issue