summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
+ }
}