summaryrefslogtreecommitdiffstats
path: root/tests/lib/template.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-04-24 15:36:02 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-04-24 15:36:02 +0200
commit88778b569e73dd2319c547be53df6aab6b8fa667 (patch)
tree78782fe023fabf8c97e5b2638aecc8a3316ca039 /tests/lib/template.php
parent0d3ddd9e11eeafbc51d95e20226117bc3424bcaf (diff)
downloadnextcloud-server-88778b569e73dd2319c547be53df6aab6b8fa667.tar.gz
nextcloud-server-88778b569e73dd2319c547be53df6aab6b8fa667.zip
Split testP() tests into multiple methods.
Diffstat (limited to 'tests/lib/template.php')
-rw-r--r--tests/lib/template.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/lib/template.php b/tests/lib/template.php
index 40aec402347..299eb2b9369 100644
--- a/tests/lib/template.php
+++ b/tests/lib/template.php
@@ -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);