From 0a015988a9a3270416733697f5a42e24bb8f1bbe Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Fri, 6 Apr 2012 16:40:36 +0200 Subject: transformed parser unit tests to phpunit --- _test/cases/inc/parser/xhtml_links.test.php | 1 + 1 file changed, 1 insertion(+) (limited to '_test/cases/inc/parser/xhtml_links.test.php') diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php index a9a6dfdbc..cac5e9252 100644 --- a/_test/cases/inc/parser/xhtml_links.test.php +++ b/_test/cases/inc/parser/xhtml_links.test.php @@ -1,5 +1,6 @@ Date: Wed, 18 Apr 2012 12:00:10 +0200 Subject: removed deprecated old test framework --- _test/cases/inc/parser/xhtml_links.test.php | 240 ---------------------------- 1 file changed, 240 deletions(-) delete mode 100644 _test/cases/inc/parser/xhtml_links.test.php (limited to '_test/cases/inc/parser/xhtml_links.test.php') diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php deleted file mode 100644 index cac5e9252..000000000 --- a/_test/cases/inc/parser/xhtml_links.test.php +++ /dev/null @@ -1,240 +0,0 @@ -emaillink('foo@example.com',''); - - $expect = '<script>alert('"alert"');</script>'; - - $this->assertEqual($p->doc,$expect); - } - - function test_emaillink_with_media(){ - global $conf; - $conf['mailguard'] = 'visible'; - $conf['userewrite'] = 2; - - $image = array( - 'type'=>'internalmedia', - 'src'=>'img.gif', - 'title'=>'Some Image', - 'align'=>NULL, - 'width'=>10, - 'height'=>20, - 'cache'=>'nocache', - 'linking'=>'details', - ); - - $p = new Doku_Renderer_xhtml(); - $p->emaillink('foo@example.com',$image); - - $expect = 'Some Image'; - - $this->assertEqual($p->doc,$expect); - } - - /** - * Produced by syntax like [[ ]] - */ - function test_empty_internallink(){ - $page = 'my:space'; - - global $ID; - $ID = $page; - - global $conf; - $conf['start'] = 'start'; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->internallink(''); - - - if (page_exists($page)) { - $class = 'wikilink1'; - $rel = ''; - } - else { - $class = 'wikilink2'; - $rel = ' rel="nofollow"'; - } - - $parts = split(':', $page); - $caption = $parts[count($parts)-1]; - - $expect = ''.$caption.''; - - $this->assertEqual($p->doc, $expect); - } - - /** - * Produced by syntax like [[ |my caption]] - */ - function test_empty_internallink_with_caption(){ - $page = 'my:space'; - $caption = 'my caption'; - - global $ID; - $ID = $page; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->internallink('', $caption); - - if (page_exists($page)) { - $class = 'wikilink1'; - $rel = ''; - } - else { - $class = 'wikilink2'; - $rel = ' rel="nofollow"'; - } - - $expect = ''.$caption.''; - - $this->assertEqual($p->doc, $expect); - } - - /** - * Produced by syntax like [[?do=index]] - */ - function test_empty_internallink_index(){ - $page = 'my:space'; - - global $ID; - $ID = $page; - - global $conf; - $conf['start'] = 'start'; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->internallink('?do=index'); - - if (page_exists($page)) { - $class = 'wikilink1'; - $rel = ''; - } - else { - $class = 'wikilink2'; - $rel = ' rel="nofollow"'; - } - - $parts = split(':', $page); - $caption = $parts[count($parts)-1]; - - $expect = ''.$caption.''; - - $this->assertEqual($p->doc, $expect); - } - - /** - * Produced by syntax like [[?do=index|my caption]] - */ - function test_empty_internallink_index_with_caption(){ - $page = 'my:space'; - $caption = 'my caption'; - - global $ID; - $ID = $page; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->internallink('?do=index', $caption); - - if (page_exists($page)) { - $class = 'wikilink1'; - $rel = ''; - } - else { - $class = 'wikilink2'; - $rel = ' rel="nofollow"'; - } - - $expect = ''.$caption.''; - - $this->assertEqual($p->doc, $expect); - } - - /** - * Produced by syntax like [[#test]] - */ - function test_empty_locallink(){ - $page = 'my:spacex'; - global $ID; - $ID = $page; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->locallink('test'); - - $expect = 'test'; - - $this->assertEqual($p->doc, $expect); - } - - /** - * Produced by syntax like [[#test|my caption]] - */ - function test_empty_locallink_with_caption(){ - $page = 'my:spacex'; - $caption = 'my caption'; - - global $ID; - $ID = $page; - - global $conf; - $conf['basedir'] = '/'; - $conf['useheading'] = 0; - $conf['userewrite'] = 0; - $conf['useslash'] = 0; - $conf['canonical'] = 0; - - $p = new Doku_Renderer_xhtml(); - $p->locallink('test', $caption); - - $expect = ''.$caption.''; - - $this->assertEqual($p->doc, $expect); - } -} -- cgit v1.2.3