[Fusionforge-commits] r14768 - trunk/tests/unit/utils

Alain Peyrat aljeux at fusionforge.org
Wed Nov 9 11:03:56 CET 2011


Author: aljeux
Date: 2011-11-09 11:03:55 +0100 (Wed, 09 Nov 2011)
New Revision: 14768

Modified:
   trunk/tests/unit/utils/TextSanitizerTest.php
Log:
Add more unit tests for purify

Modified: trunk/tests/unit/utils/TextSanitizerTest.php
===================================================================
--- trunk/tests/unit/utils/TextSanitizerTest.php	2011-11-09 10:02:39 UTC (rev 14767)
+++ trunk/tests/unit/utils/TextSanitizerTest.php	2011-11-09 10:03:55 UTC (rev 14768)
@@ -46,4 +46,23 @@
 	{
 		$this->assertEquals('Hacker ', $this->s->purify('Hacker <script>hello</script>'));
 	}
+
+	/**
+	 * test purify on other html piece of code.
+	 */
+	public function testPurifyOnMiscCode()
+	{
+		$in  = "</div>\n<div>> rep > rep</div>\n<div>";
+		$out = "\n<div>> rep > rep</div>\n";
+		$this->assertEquals($out, $this->s->purify($in));
+	}
+	
+	/**
+	 * test purify on other html piece of code.
+	 */
+	public function testPurifyOnMiscCode2()
+	{
+		$text = '<b>ceci</b> <i>est</i> <u>une</u> <font color="#cc0000">reponse</font>';
+		$this->assertEquals($text, $this->s->purify($text));
+	}
 }




More information about the Fusionforge-commits mailing list