From 1e2468e4b9e9fb44055757a5460df1a6bf31313b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 22 Mar 2013 10:23:39 +0100 Subject: Added two tests for HTML comments handling in rcube_washtml class --- tests/Framework/Washtml.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/Framework/Washtml.php b/tests/Framework/Washtml.php index 6f4aa9783..cd443266f 100644 --- a/tests/Framework/Washtml.php +++ b/tests/Framework/Washtml.php @@ -18,7 +18,6 @@ class Framework_Washtml extends PHPUnit_Framework_TestCase .'Internet Explorer

'; $washer = new rcube_washtml; - $washed = $washer->wash($html); $this->assertNotRegExp('/data:text/', $washed, "Remove data:text/html links"); @@ -33,10 +32,27 @@ class Framework_Washtml extends PHPUnit_Framework_TestCase $html = "

Firefox"; $washer = new rcube_washtml; - $washed = $washer->wash($html); $this->assertRegExp('|href="http://test.com">|', $washed, "Link href with newlines (#1488940)"); } + /** + * Test handling HTML comments + */ + function test_comments() + { + $washer = new rcube_washtml; + + $html = "

p2

"; + $washed = $washer->wash($html); + + $this->assertEquals('

p2

', $washed, "HTML conditional comments (#1489004)"); + + $html = "

test

', $washed, "HTML invalid comments (#1487759)"); + } + } -- cgit v1.2.3