Fix external link rendering and add test case

This commit is contained in:
Adrian Lang
2011-05-31 13:49:14 +02:00
parent 1bc97b2f64
commit 7dc0ff4ecd
2 changed files with 28 additions and 1 deletions

27
_test/inverse.test.php Normal file
View File

@ -0,0 +1,27 @@
<?php
require_once DOKU_INC.'_test/lib/unittest.php';
require_once DOKU_INC.'inc/init.php';
require_once dirname(__FILE__) . '/../inverse.php';
class edittable_test_inverse extends Doku_UnitTestCase {
function test() {
$this->externallink();
}
function externallink() {
$text = '[[file:///x:\folder\file.zip]]';
$this->render($text);
}
protected function render($text) {
$instructions = p_get_instructions($text);
$Renderer = new Doku_Renderer_wiki;
foreach ( $instructions as $instruction ) {
// Execute the callback against the Renderer
call_user_func_array(array(&$Renderer, $instruction[0]),$instruction[1]);
}
$this->assertEqual($Renderer->doc, $text);
}
}