diff --git a/tests/unit/includes/TextTest.php b/tests/unit/includes/TextTest.php
index 2b4cb19ea..85ed6a4fd 100644
--- a/tests/unit/includes/TextTest.php
+++ b/tests/unit/includes/TextTest.php
@@ -5,7 +5,7 @@ namespace Zotlabs\Tests\Unit\includes;
use Zotlabs\Tests\Unit\UnitTestCase;
/**
- * @brief Unit Test case for texter.
+ * @brief Unit Test case for include/texter.php file.
*
* @author ken restivo
*/
@@ -24,14 +24,55 @@ class TextTest extends UnitTestCase {
}
public function testPurifyHTML() {
- $html = '
close missing tags'));
+ $this->assertEquals('
deprecated tag', purify_html('
deprecated tag'));
+ $this->assertEquals('
illegal nesting
', purify_html('
illegal nesting
'));
+ $this->assertEquals('
link with target', purify_html('
link with target'));
+ $this->assertEquals('
link with rel="nofollow"', purify_html('
link with rel="nofollow"'));
+ $this->assertEquals('a b', purify_html('a b'));
+ $this->assertEquals('ä ä € €', purify_html('ä ä € €'));
+ }
+
+ public function testPurifyHTML_js() {
+ $this->assertEquals('
', purify_html('
'));
+ $this->assertEquals('
link', purify_html('
link'));
+ $this->assertEquals('', purify_html('
;)
'));
+ $this->assertEquals('', purify_html(''));
+ }
+
+ public function testPurifyHTML_css() {
+ $this->assertEquals('
red
', purify_html('
red
'));
+ $this->assertEquals('
invalid color
', purify_html('
invalid color
'));
+ $this->assertEquals('
invalid style
', purify_html('
invalid style
'));
+
+ // test our own CSS configuration
+ $this->assertEquals('
position removed
', purify_html('
position removed
'));
+ $this->assertEquals('
position preserved
', purify_html('
position preserved
', true));
+ $this->assertEquals('
invalid position removed
', purify_html('
invalid position removed
', true));
+
+ $this->assertEquals('
position removed
', purify_html('
position removed
'));
+ $this->assertEquals('
position preserved
', purify_html('
position preserved
', true));
+ $this->assertEquals('
invalid position removed
', purify_html('
invalid position removed
', true));
+ }
+
+}