XSL file to convert HTML to tomboy markup
[grauphel.git] / tests / html2tomboyXslTest.php
diff --git a/tests/html2tomboyXslTest.php b/tests/html2tomboyXslTest.php
new file mode 100644 (file)
index 0000000..5e9139e
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+class html2tomboyXslTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * Use xsltproc and diff to check if the XSL file generates
+     * the same output as we expect.
+     */
+    public function testFormat()
+    {
+        exec(
+            'xsltproc'
+            . ' ../templates/html2tomboy.xsl'
+            . ' data/full-formattest.html'
+            . ' | diff -u data/formattest.tomboynotecontent -',
+            $out,
+            $retval
+        );
+        $this->assertEquals(
+            0, $retval,
+            "diff exit status is not 0:\n" . implode("\n", $out)
+        );
+    }
+}
+?>
\ No newline at end of file