aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/full-formattest.html41
-rw-r--r--tests/html2tomboyXslTest.php24
2 files changed, 65 insertions, 0 deletions
diff --git a/tests/data/full-formattest.html b/tests/data/full-formattest.html
new file mode 100644
index 0000000..74d27c0
--- /dev/null
+++ b/tests/data/full-formattest.html
@@ -0,0 +1,41 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Test</title>
+ </head>
+ <body>Eine Zeile Text.<br />
+Zeilenumbruch.<br />
+Noch ein Zeilenumbruch.<br />
+<br />
+Eine Leerzeile obendrüber.<br />
+<br />
+Jetzt kommt eine Liste:<br />
+<ul><li>eins<br />
+</li><li>zwei<br />
+<ul><li>zwei-eins<br />
+<ul><li>zwei-eins-eins<br />
+</li><li>zwei-eins-zwei<br />
+</li></ul></li><li>zwei-zwei<br />
+</li></ul></li><li>drei<br />
+<ul><li>drei-eins<br />
+<ul><li>drei-eins-eins<br />
+<ul><li>drei-eins-eins-eins</li></ul></li></ul></li></ul></li></ul>
+Formatierungen:<br />
+<b>Fetter Text</b><br />
+<i>Kursiver Text</i><br />
+<span class="strikethrough">Durchgestrichener Text</span><br />
+<span class="highlight">Hervorgehobener Text</span><br />
+<span style="font-family:monospace; white-space: pre-wrap">Feste Breite</span><br />
+<br />
+Schriftgrößen:<br />
+<span class="small">klein</span><br />
+normal<br />
+<span class="large">groß</span><br />
+<span class="huge">riesig</span><br />
+<br />
+Links:<br />
+<ul><li><a href="Test.htm">Test</a><br />
+</li><li><a href="http://cweiske.de/?foo#bar">http://cweiske.de/?foo#bar</a><br />
+</li><li><a href="file:///home/cweiske/fam.jpg">/home/cweiske/fam.jpg</a></li></ul>
+<br />
+Ende.<br /></body>
+</html>
diff --git a/tests/html2tomboyXslTest.php b/tests/html2tomboyXslTest.php
new file mode 100644
index 0000000..5e9139e
--- /dev/null
+++ b/tests/html2tomboyXslTest.php
@@ -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