summaryrefslogtreecommitdiff
path: root/_test/cases
diff options
context:
space:
mode:
authorIzidor Matušov <izidor.matusov@gmail.com>2011-04-04 11:06:40 +0200
committerMichael Hamann <michael@content-space.de>2011-04-07 18:00:12 +0200
commit4ab823396c3a43defae8363fec0e0eceb90720e6 (patch)
treec341f9fa2991d1855d7982c38125d33376744ed5 /_test/cases
parentc006739e4780df86d205d5ebc6f39af141cbc3eb (diff)
downloadrpg-4ab823396c3a43defae8363fec0e0eceb90720e6.tar.gz
rpg-4ab823396c3a43defae8363fec0e0eceb90720e6.tar.bz2
Unit test cases for FS 2178
Diffstat (limited to '_test/cases')
-rw-r--r--_test/cases/inc/parser/xhtml_links.test.php89
1 files changed, 89 insertions, 0 deletions
diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php
index 0ad96c793..4954086a2 100644
--- a/_test/cases/inc/parser/xhtml_links.test.php
+++ b/_test/cases/inc/parser/xhtml_links.test.php
@@ -41,4 +41,93 @@ class xhtml_links_test extends UnitTestCase {
$this->assertEqual($p->doc,$expect);
}
+ /**
+ * Produced by syntax like [[ ]]
+ */
+ function test_empty_internallink(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->internallink('');
+
+ $expect = '<span class="curid"><a href="/./doku.php/my:space" class="wikilink1" title="my:space">start</a></span>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
+
+ /**
+ * Produced by syntax like [[ |my caption]]
+ */
+ function test_empty_internallink_with_caption(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->internallink('', 'my caption');
+
+ $expect = '<span class="curid"><a href="/./doku.php/my:space" class="wikilink1" title="my:space">my caption</a></span>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
+
+ /**
+ * Produced by syntax like [[?do=index]]
+ */
+ function test_empty_internallink_index(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->internallink('?do=index');
+
+ $expect = '<span class="curid"><a href="/./doku.php/my:space?do=index" class="wikilink1" title="my:space">start</a></span>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
+
+ /**
+ * Produced by syntax like [[?do=index|my caption]]
+ */
+ function test_empty_internallink_index_with_caption(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->internallink('?do=index', 'my caption');
+
+ $expect = '<span class="curid"><a href="/./doku.php/my:space?do=index" class="wikilink1" title="my:space">my caption</a></span>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
+
+ /**
+ * Produced by syntax like [[#test]]
+ */
+ function test_empty_locallink(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->locallink('test');
+
+ $expect = '<a href="#test" title="my:space &crarr;" class="wikilink1">test</a>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
+
+ /**
+ * Produced by syntax like [[#test|my caption]]
+ */
+ function test_empty_locallink_with_caption(){
+ global $ID;
+ $ID = 'my:space';
+
+ $p = new Doku_Renderer_xhtml();
+ $p->locallink('test', 'my caption');
+
+ $expect = '<a href="#test" title="my:space &crarr;" class="wikilink1">my caption</a>';
+
+ $this->assertEqual($p->doc, $expect);
+ }
}