]> source.dussan.org Git - nextcloud-server.git/commitdiff
Split testP() tests into multiple methods.
authorAndreas Fischer <bantu@owncloud.com>
Thu, 24 Apr 2014 13:36:02 +0000 (15:36 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Thu, 24 Apr 2014 13:36:02 +0000 (15:36 +0200)
tests/lib/template.php

index 40aec402347455a26d448f7fd9be658585566ed9..299eb2b93691979abe1005388e4222717e66c019 100644 (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);