aboutsummaryrefslogtreecommitdiff
path: root/tests/Lib
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-10-23 23:07:01 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-10-23 23:07:01 +0200
commit8ee6bfe97633d31c6b89cebbc434837eca04d6dd (patch)
tree3d346e6d6b18e608813924b784ebda1d6520beef /tests/Lib
parenta6e6dc9e303ccddf1cb6e699f5e43295af361e0f (diff)
downloadgrauphel-8ee6bfe97633d31c6b89cebbc434837eca04d6dd.tar.gz
grauphel-8ee6bfe97633d31c6b89cebbc434837eca04d6dd.zip
note preview
Diffstat (limited to 'tests/Lib')
-rw-r--r--tests/Lib/Converter/HtmlTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/Lib/Converter/HtmlTest.php b/tests/Lib/Converter/HtmlTest.php
new file mode 100644
index 0000000..0a66ee4
--- /dev/null
+++ b/tests/Lib/Converter/HtmlTest.php
@@ -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