Skip to content
Snippets Groups Projects
Commit 4ab82339 authored by Izidor Matušov's avatar Izidor Matušov Committed by Michael Hamann
Browse files

Unit test cases for FS 2178

parent c006739e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment