Browse Source

Split testP() tests into multiple methods.

tags/v7.0.0alpha2
Andreas Fischer 10 years ago
parent
commit
88778b569e
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      tests/lib/template.php

+ 3
- 1
tests/lib/template.php View File

@@ -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('&lt;img onload=&quot;alert(1)&quot; /&gt;', $result);
}

public function testPJavaScriptWithScriptTags() {
$badString = "<script>alert('Hacked!');</script>";
ob_start();
p($badString);

Loading…
Cancel
Save