Esempio n. 1
0
 /**
  * Takes a list of tests, and run them.
  * @param	array	$tests	List of tests.
  */
 private function _executeTests($tests)
 {
     $skriv = \Skriv\Markup\Renderer::factory();
     foreach ($tests as $name => $data) {
         list($source, $expected) = $data;
         $res = $skriv->render($source);
         $this->assertEquals(trim($expected), trim($res), "Error for '{$name}'.");
         $this->assertEquals(0, count($skriv->getErrors()), "Errors detected by WikiRenderer.");
     }
 }
Esempio n. 2
0
 protected function transformSkriv($str, $config)
 {
     $renderer = SkrivRenderer::factory('html', $config);
     $html = $renderer->render($str);
     $footnotes_html = $renderer->getFootnotes();
     if ($footnotes_html) {
         $footnotes_html = PressHTMLTransformer::unwrapFootnotes($footnotes_html);
     }
     return ['html' => $html, 'footnotes_html' => $footnotes_html];
 }