note preview
[grauphel.git] / tests / Lib / Converter / HtmlTest.php
diff --git a/tests/Lib/Converter/HtmlTest.php b/tests/Lib/Converter/HtmlTest.php
new file mode 100644 (file)
index 0000000..0a66ee4
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+require_once __DIR__ . '/../../../lib/converter/html.php';
+
+class Lib_Converter_HtmlTest extends PHPUnit_Framework_TestCase
+{
+    public function testConvert()
+    {
+        $input = file_get_contents(__DIR__ . '/../../data/formattest.tomboynotecontent');
+
+        $converter = new OCA\Grauphel\Lib\Converter\Html();
+        $output = $converter->convert($input);
+        $this->assertEquals(
+            file_get_contents(__DIR__ . '/../../data/formattest.html'),
+            $output
+        );
+    }
+
+    public function testXSS()
+    {
+        $input = file_get_contents(__DIR__ . '/../../data/xss.tomboynotecontent');
+
+        $converter = new OCA\Grauphel\Lib\Converter\Html();
+        $output = $converter->convert($input);
+        $this->assertEquals(
+            file_get_contents(__DIR__ . '/../../data/xss.html'),
+            $output
+        );
+    }
+}
+?>
\ No newline at end of file