function testFootnote() { $conf = new wr3_to_xhtml(); $conf->onStart(''); $wip = new WikiInlineParser($conf); $source = 'Lorem ipsum dolor sit amet, $$consectetuer __adipis__cing$$ elit.'; $res = $wip->parse($source); $id = 'footnote-' . $conf->footnotesId . '-1'; $trueResult = 'Lorem ipsum dolor sit amet, <span class="footnote-ref">[<a href="#' . $id . '" name="rev-' . $id . '" id="rev-' . $id . '">1</a>]</span> elit.'; $trueFootnote = '<p>[<a href="#rev-' . $id . '" name="' . $id . '" id="' . $id . '">1</a>] consectetuer <strong>adipis</strong>cing</p>'; $this->assertEqualOrDiff($trueResult, $res, "erreur footnote"); $this->assertEqual(1, count($conf->footnotes), "erreur footnote : nombre de footnote"); $this->assertEqualOrDiff($trueFootnote, $conf->footnotes[0], "erreur footnote : mauvaise footnote"); }
function testInlineParser2() { $conf = new WRConfigTest(); $conf->simpletags = array('%%%' => ''); $conf->defaultTextLineContainer = 'WikiHtmlTextLine'; $conf->textLineContainers = array('WikiHtmlTextLine' => array('cwrxhtml_strong', 'cwrxhtml_em', 'cwrxhtml_code', 'cwrxhtml_q', 'cwrxhtml_cite', 'cwrxhtml_acronym', 'cwrxhtml_link', 'cwrxhtml_image', 'cwrxhtml_anchor')); $conf->funcCheckWikiWord = null; $wip = new WikiInlineParser($conf); $k = 0; foreach ($this->listinline2 as $source => $trueResult) { $k++; $res = $wip->parse($source); $this->assertEquals($trueResult, $res, "erreur"); } }