Commits

Laurent Jouanneau  committed 6819769

moved tests on phpwiki_to_dokuwiki to phpunit

  • Participants
  • Parent commits 8b8cf9e

Comments (0)

Files changed (8)

File tests/common.php

 Unit tests on WikiRenderer <?php echo WIKIRENDERER_VERSION;?> (PHP <?php echo phpversion() ?>)
 <ul>
  <li><a href="index.php">All tests</a></li>
- <li>phpwiki to dokuwiki:
-    <a href="phpwiki_dokuwiki_inlines.php">inlines</a> |
-    <a href="phpwiki_dokuwiki_blocks.php">blocks</a>
- </li>
-
 </ul>
 </div>
 

File tests/dokuwiki_docbook_inlinesTest.php

             =>'<para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</para>',
         'Lorem ipsum dolor sit amet, \\\\
 consectetuer adipiscing elit.'
-            =>'<para>Lorem ipsum dolor sit amet,
+            =>'<para>Lorem ipsum dolor sit amet, 
 consectetuer adipiscing elit.</para>',
         'Lorem [[ipsum dolor]] sit amet, consectetuer adipiscing elit.'
             =>'<para>Lorem <ulink url="ipsum dolor">ipsum dolor</ulink> sit amet, consectetuer adipiscing elit.</para>',

File tests/index.php

 
 $test = &new GroupTest('All tests');
 
-require_once('phpwiki_dokuwiki_inlines.php');
-$test->addTestCase(new phpwiki_dokuwiki_inlines());
-
-require_once('phpwiki_dokuwiki_blocks.php');
-$test->addTestCase(new phpwiki_dokuwiki_blocks());
-
 $test->run(new HtmlReporter2());

File tests/phpunit.xml

       <file>trac_blocksTest.php</file>
       <file>trac_inlinesTest.php</file>
     </testsuite>
+
+    <testsuite name="phpwiki syntax">
+      <file>phpwiki_dokuwiki_blocksTest.php</file>
+      <file>phpwiki_dokuwiki_inlinesTest.php</file>
+    </testsuite>
+
   </testsuites>
 </phpunit>

File tests/phpwiki_dokuwiki_blocks.php

-<?php
-/**
- * Unit tests for phpwiki to dokuwiki syntax conversion.
- *
- * blocks tags
- *
- * @package wikirenderer
- * @subpackage tests
- * @author Laurent Jouanneau
- * @copyright 2009 Laurent Jouanneau
- */
-
-require_once('common.php');
-require_once(WR_DIR.'rules/phpwiki_to_dokuwiki.php');
-
-class phpwiki_dokuwiki_blocks extends WikiRendererUnitTestCase {
-
-    protected $data = array(
-0=>array(
-'',
-'',
-0),
-
-1=>array(
-'
-Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-',
-'
-Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-',
-0),
-
-2=>array(
-'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-0),
-
-3=>array(
-'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-0),
-
-
-4=>array(
-"Lorem __ipsum dolor__ sit amet, ''consectetuer adipiscing'' elit. Ut scelerisque. Ut iaculis ultrices nulla. Cras viverra diam nec justo.
-
-* Phasellus non eros sit amet sem tristique laoreet.
-*# Nam mi wisi, pellentesque dictum,
-*# tristique in, tristique quis, erat.
-*## In in erat ut urna vulputate vestibulum. Aenean justo.
-*## In quis nisl.
-* Morbi justo libero, pharetra a,
-* malesuada eget, lacinia in, ligula.
-
-Mauris [sit amet massa|http://ljouanneau.com] pretium dapibus.",
-
-"Lorem **ipsum dolor** sit amet, //consectetuer adipiscing// elit. Ut scelerisque. Ut iaculis ultrices nulla. Cras viverra diam nec justo.
-
-   * Phasellus non eros sit amet sem tristique laoreet.
-      # Nam mi wisi, pellentesque dictum,
-      # tristique in, tristique quis, erat.
-         # In in erat ut urna vulputate vestibulum. Aenean justo.
-         # In quis nisl.
-   * Morbi justo libero, pharetra a,
-   * malesuada eget, lacinia in, ligula.
-
-Mauris [[http://ljouanneau.com|sit amet massa]] pretium dapibus.",
-0),
-
-5=>array(
-'In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
------
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.',
-    
-'In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
-
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.',
-0
-),
-6=>array(
-'!!!In hac habitasse \'\'platea\'\' dictumst. Nulla facilisi.
-
-!!Pellentesque __sodales__ laoreet est.
-Phasellus non eros sit amet sem tristique laoreet.
-!Nulla varius egestas risus.
-Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.',
-'= In hac habitasse //platea// dictumst. Nulla facilisi. =
-
-== Pellentesque **sodales** laoreet est. ==
-Phasellus non eros sit amet sem tristique laoreet.
-=== Nulla varius egestas risus. ===
-Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.',
-0),
-
-7=>array(
-'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit.
-
- Cras __interdum__.
- Donec DiCtum. [Sed fringilla].
- Duis !FeuGiat [[pharetra] tortor.
- Nulla facilisi.
-
-In hac habitasse platea dictumst. Nulla facilisi.',
-'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit.
-
-<code> Cras interdum.
- Donec DiCtum. [Sed fringilla].
- Duis FeuGiat [pharetra] tortor.
- Nulla facilisi.</code>
-
-In hac habitasse platea dictumst. Nulla facilisi.',
-0),
-8=>array(
-'||  __Nom__               |v __Coût__   |v __Notes__
-| __Prénom__   | __Nom de famille__
-|> Jeff       |< Dairiki   |^  Pas cher     |< Pas valable
-|> Marco      |< Polo      | Encore moins cher     |< Pas disponible',
-'| **Nom** || **Coût** | **Notes** |
-| **Prénom** | **Nom de famille** | | |
-|   Jeff | Dairiki   |   Pas cher   | Pas valable   |
-|   Marco | Polo   | Encore moins cher | Pas disponible   |',
-0),
-9=>array(
-'| __Nom__               |v __Coût__   | __Notes__ 
-| __Prénom__   | __Nom de famille__
-|  Jeff       |< Dairiki   |^  Pas cher    
-|| Polo    | ooo   ',
-'| **Nom** | **Coût** | **Notes** |
-| **Prénom** | | **Nom de famille** |
-| Jeff | Dairiki   |   Pas cher   |
-| Polo || ooo |',
-0),
-/* bug on latest line: combination on rowspan+colspan
-10=>array(
-'| __Nom__               |v __Coût__   | __Notes__ 
-| __Prénom__   | __Nom de famille__
-|v Jeff       |< Dairiki   |^  Pas cher    
-|| Polo       ',
-'| **Nom** | **Coût** | **Notes** |
-| **Prénom** | | **Nom de famille** |
-| Jeff | Dairiki   |   Pas cher   |
-| | Polo ||',
-0),
-              */
-11=>array(
-'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
-;:Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-;:
-;:In hac habitasse platea \'\'dictumst. Nulla\'\' facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
->Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
->
->In hac habitasse platea //dictumst. Nulla// facilisi. Pellentesque sodales laoreet est.
-Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
-luctus luctus. Aliquam nec lacus. Integer egestas.
-',
-0),
-
-12=>array(
-'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-<?plugin nom  param=value?>
-
-In hac habitasse platea \'\'dictumst. Nulla\'\' facilisi.
-<?plugin nom2 ?>
-<?plugin nom3?>
-
-Pellentesque sodales laoreet est.
-Nulla varius egestas risus.',
-'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
-Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
-
-~~nom:param=value~~
-
-In hac habitasse platea //dictumst. Nulla// facilisi.
-~~nom2~~
-~~nom3~~
-
-Pellentesque sodales laoreet est.
-Nulla varius egestas risus.',
-0),
-
-    );
-
-
-
-    public function testBlocks() {
-        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
-        foreach($this->data as $k=>$test){
-            list($source, $result, $nberror) = $test;
-            $res = $wr->render($source);
-
-            $this->assertEqualOrDiff($result, $res, "error on $k th test");
-
-            if(!$this->assertEqual(count($wr->errors), $nberror, "Errors detected by wr ! (%s)")){
-                $this->dump($wr->errors);
-            }
-        }
-    }
-
-
-    protected $listblocks = array( '1'=>3
-    );
-
-    function testBlockFiles() {
-
-        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
-        foreach($this->listblocks as $file=>$nberror){
-            $sourceFile = 'datasblocks/pw_dk_'.$file.'.src';
-            $resultFile = 'datasblocks/pw_dk_'.$file.'.res';
-
-            $source = file_get_contents($sourceFile);
-            $result = file_get_contents($resultFile);
-
-            $res = $wr->render($source);
-            $this->assertEqualOrDiff($result, $res, "error on $file");
-            echo '<!--'.$res.'-->';
-            if(!$this->assertEqual(count($wr->errors), $nberror, "Errors detected by wr ! (%s)")){
-                $this->dump($wr->errors);
-            }
-        }
-    }
-}
-
-if(!defined('ALL_TESTS')) {
-    $test = new phpwiki_dokuwiki_blocks();
-    $test->run(new HtmlReporter2());
-}

File tests/phpwiki_dokuwiki_blocksTest.php

+<?php
+/**
+ * Unit tests for phpwiki to dokuwiki syntax conversion.
+ *
+ * blocks tags
+ *
+ * @package wikirenderer
+ * @subpackage tests
+ * @author Laurent Jouanneau
+ * @copyright 2009-2011 Laurent Jouanneau
+ */
+
+require_once(WR_DIR.'rules/phpwiki_to_dokuwiki.php');
+
+class phpwiki_dokuwiki_blocks extends PHPUnit_Framework_TestCase {
+
+    protected $data = array(
+0=>array(
+'',
+'',
+0),
+
+1=>array(
+'
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+',
+'
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+',
+0),
+
+2=>array(
+'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+0),
+
+3=>array(
+'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+0),
+
+
+4=>array(
+"Lorem __ipsum dolor__ sit amet, ''consectetuer adipiscing'' elit. Ut scelerisque. Ut iaculis ultrices nulla. Cras viverra diam nec justo.
+
+* Phasellus non eros sit amet sem tristique laoreet.
+*# Nam mi wisi, pellentesque dictum,
+*# tristique in, tristique quis, erat.
+*## In in erat ut urna vulputate vestibulum. Aenean justo.
+*## In quis nisl.
+* Morbi justo libero, pharetra a,
+* malesuada eget, lacinia in, ligula.
+
+Mauris [sit amet massa|http://ljouanneau.com] pretium dapibus.",
+
+"Lorem **ipsum dolor** sit amet, //consectetuer adipiscing// elit. Ut scelerisque. Ut iaculis ultrices nulla. Cras viverra diam nec justo.
+
+   * Phasellus non eros sit amet sem tristique laoreet.
+      # Nam mi wisi, pellentesque dictum,
+      # tristique in, tristique quis, erat.
+         # In in erat ut urna vulputate vestibulum. Aenean justo.
+         # In quis nisl.
+   * Morbi justo libero, pharetra a,
+   * malesuada eget, lacinia in, ligula.
+
+Mauris [[http://ljouanneau.com|sit amet massa]] pretium dapibus.",
+0),
+
+5=>array(
+'In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+-----
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.',
+
+'In hac habitasse platea dictumst. Nulla facilisi. Pellentesque sodales laoreet est.
+
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.',
+0
+),
+6=>array(
+'!!!In hac habitasse \'\'platea\'\' dictumst. Nulla facilisi.
+
+!!Pellentesque __sodales__ laoreet est.
+Phasellus non eros sit amet sem tristique laoreet.
+!Nulla varius egestas risus.
+Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.',
+'= In hac habitasse //platea// dictumst. Nulla facilisi. =
+
+== Pellentesque **sodales** laoreet est. ==
+Phasellus non eros sit amet sem tristique laoreet.
+=== Nulla varius egestas risus. ===
+Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.',
+0),
+
+7=>array(
+'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit.
+
+ Cras __interdum__.
+ Donec DiCtum. [Sed fringilla].
+ Duis !FeuGiat [[pharetra] tortor.
+ Nulla facilisi.
+
+In hac habitasse platea dictumst. Nulla facilisi.',
+'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit.
+
+<code> Cras interdum.
+ Donec DiCtum. [Sed fringilla].
+ Duis FeuGiat [pharetra] tortor.
+ Nulla facilisi.</code>
+
+In hac habitasse platea dictumst. Nulla facilisi.',
+0),
+8=>array(
+'||  __Nom__               |v __Coût__   |v __Notes__
+| __Prénom__   | __Nom de famille__
+|> Jeff       |< Dairiki   |^  Pas cher     |< Pas valable
+|> Marco      |< Polo      | Encore moins cher     |< Pas disponible',
+'| **Nom** || **Coût** | **Notes** |
+| **Prénom** | **Nom de famille** | | |
+|   Jeff | Dairiki   |   Pas cher   | Pas valable   |
+|   Marco | Polo   | Encore moins cher | Pas disponible   |',
+0),
+9=>array(
+'| __Nom__               |v __Coût__   | __Notes__
+| __Prénom__   | __Nom de famille__
+|  Jeff       |< Dairiki   |^  Pas cher
+|| Polo    | ooo   ',
+'| **Nom** | **Coût** | **Notes** |
+| **Prénom** | | **Nom de famille** |
+| Jeff | Dairiki   |   Pas cher   |
+| Polo || ooo |',
+0),
+/* bug on latest line: combination on rowspan+colspan
+10=>array(
+'| __Nom__               |v __Coût__   | __Notes__
+| __Prénom__   | __Nom de famille__
+|v Jeff       |< Dairiki   |^  Pas cher
+|| Polo       ',
+'| **Nom** | **Coût** | **Notes** |
+| **Prénom** | | **Nom de famille** |
+| Jeff | Dairiki   |   Pas cher   |
+| | Polo ||',
+0),
+              */
+11=>array(
+'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
+;:Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+;:
+;:In hac habitasse platea \'\'dictumst. Nulla\'\' facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
+>Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+>
+>In hac habitasse platea //dictumst. Nulla// facilisi. Pellentesque sodales laoreet est.
+Nulla varius egestas risus. Duis sollicitudin tempor arcu. Mauris porta leo id dui
+luctus luctus. Aliquam nec lacus. Integer egestas.
+',
+0),
+
+12=>array(
+'Lorem ipsum __dolor__ sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+<?plugin nom  param=value?>
+
+In hac habitasse platea \'\'dictumst. Nulla\'\' facilisi.
+<?plugin nom2 ?>
+<?plugin nom3?>
+
+Pellentesque sodales laoreet est.
+Nulla varius egestas risus.',
+'Lorem ipsum **dolor** sit amet, consectetuer adipiscing elit. Cras interdum.
+Donec dictum. Sed fringilla. Duis feugiat pharetra tortor. Nulla facilisi.
+
+~~nom:param=value~~
+
+In hac habitasse platea //dictumst. Nulla// facilisi.
+~~nom2~~
+~~nom3~~
+
+Pellentesque sodales laoreet est.
+Nulla varius egestas risus.',
+0),
+
+    );
+
+
+
+    public function testBlocks() {
+        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
+        foreach($this->data as $k=>$test){
+            list($source, $result, $nberror) = $test;
+            $res = $wr->render($source);
+            $this->assertEquals($result, $res, "error on $k th test");
+
+            $this->assertEquals($nberror, count($wr->errors), "Errors detected by wr");
+        }
+    }
+
+
+    protected $listblocks = array( '1'=>3
+    );
+
+    function testBlockFiles() {
+
+        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
+        foreach($this->listblocks as $file=>$nberror){
+            $sourceFile = 'datasblocks/pw_dk_'.$file.'.src';
+            $resultFile = 'datasblocks/pw_dk_'.$file.'.res';
+
+            $source = file_get_contents($sourceFile);
+            $result = file_get_contents($resultFile);
+
+            $res = $wr->render($source);
+            $this->assertEquals($result, $res, "error on $file");
+            $this->assertEquals($nberror, count($wr->errors), "Errors detected by wr");
+        }
+    }
+}

File tests/phpwiki_dokuwiki_inlines.php

-<?php
-/**
- * Unit tests for phpwiki to dokuwiki syntax conversion.
- *
- * inlines tags
- *
- * @package wikirenderer
- * @subpackage tests
- * @author Laurent Jouanneau
- * @copyright 2009 Laurent Jouanneau
- */
-
-
-require_once('common.php');
-require_once(WR_DIR.'rules/phpwiki_to_dokuwiki.php');
-
-class phpwiki_dokuwiki_inlines extends WikiRendererUnitTestCase {
-    
-    var $listinline = array(
-        'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
-        'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.',
-        'Lorem __ipsum dolor__ sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.',
-        'Lorem __0__ sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem **0** sit amet, consectetuer adipiscing elit.',
-        'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.'
-                    =>'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.',
-        "Lorem ipsum dolor ''sit amet'', consectetuer adipiscing elit."
-                    =>'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.',
-        'Lorem ipsum dolor sit amet, <sub>consectetuer</sub> adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, <sub>consectetuer</sub> adipiscing elit.',
-        'Lorem ipsum dolor sit amet, <sup>consectetuer</sup> adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, <sup>consectetuer</sup> adipiscing elit.',
-        'Lorem ipsum dolor sit amet, <del>consectetuer</del> adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, <del>consectetuer</del> adipiscing elit.',
-        'Lorem ipsum dolor sit amet, \\\\consectetuer adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, \\consectetuer adipiscing elit.',
-        'Lorem ipsum dolor sit amet, \\\\
-consectetuer adipiscing elit.'
-                    =>'Lorem ipsum dolor sit amet, \\
-consectetuer adipiscing elit.',
-                    
-        //---- links
-        
-        'Lorem [ipsum dolor] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[ipsum dolor]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [#ipsum.dolor] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[#ipsum.dolor]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[http://foo.com|ipsum dolor]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [ipsum dolor|http://foo.com|bla|blo|bli] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[http://foo.com|ipsum dolor]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [[ipsum dolor|!http://foo.com] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.',
-        'Lorem [[ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [ipsum dolor|[[http://foo.com]]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [ ipsum dolor | javascript:alert(window.title)] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[javascript:alert(window.title)| ipsum dolor ]] sit amet, consectetuer adipiscing elit.',
-        'Lorem [[ipsumdolorsit amet], consectetuer adipiscing elit.'
-                    =>'Lorem [ipsumdolorsit amet], consectetuer adipiscing elit.',
-        'Lorem [[[[ipsumdolor sit amet], consectetuer adipiscing elit.'
-                    =>'Lorem [[ipsumdolor sit amet], consectetuer adipiscing elit.',
-        'Lorem [ipsumdolorsit amet], [[consectetuer] adipiscing elit.'
-                    =>'Lorem [[ipsumdolorsit amet]], [consectetuer] adipiscing elit.',
-        'Lorem IpsumDolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[IpsumDolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem IpsuméDolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[IpsuméDolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem IpsumDoloréSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[IpsumDoloréSit]] amet, consectetuer adipiscing elit.',
-        'Lorem !IpsumDolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem IpsumDolorSit amet, consectetuer adipiscing elit.',
-        'Lorem !!IpsumDolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem !IpsumDolorSit amet, consectetuer adipiscing elit.',
-        'Lorem [IpsumDolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[IpsumDolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem [Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[Ipsum:DolorSit|Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem [/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem [http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[http://flou.local/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem [[!http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.',
-        'Lorem [[http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[[http://flou.local/Ipsum/DolorSit]]] amet, consectetuer adipiscing elit.',
-        'Lorem http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[http://flou.local/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
-        'Lorem !http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.'
-                    =>'Lorem http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.',
-        'Lorem __http://flou.local/Ipsum/DolorSit amet__, consectetuer adipiscing elit.'
-                    =>'Lorem **[[http://flou.local/Ipsum/DolorSit]] amet**, consectetuer adipiscing elit.',
-        'Lorem [phpwiki:IpsumDolorSit?action=browse] amet, consectetuer adipiscing elit.'
-                    =>'Lorem [[IpsumDolorSit?]] amet, consectetuer adipiscing elit.',
-        'Lorem "http:" Ipsum Dolor Sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem "http:" Ipsum Dolor Sit amet, consectetuer adipiscing elit.',
-        'Lorem ipsum dolor[2] sit amet, consectetuer adipiscing elit.'
-                    =>'Lorem ipsum dolor[[!PWNOTE2!]] sit amet, consectetuer adipiscing elit.',
-
-        'Lorem [http://flou.local/Ipsum/DolorSit.png] amet, consectetuer adipiscing elit.'
-                    =>'Lorem {{http://flou.local/Ipsum/DolorSit.png}} amet, consectetuer adipiscing elit.',
-
-        'Lorem [ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
-                    =>'Lorem {{ipsumdolorsit.png}} amet, consectetuer adipiscing elit.',
-        'Lorem [alternative text|ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
-                    =>'Lorem {{ipsumdolorsit.png|alternative text}} amet, consectetuer adipiscing elit.',
-        'Lorem [ ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
-                    =>'Lorem {{ ipsumdolorsit.png}} amet, consectetuer adipiscing elit.',
-
-
-        'Le binding de Python, fut à l\'origine PyXpcom, réalisé par Activestate et anciennement disponible sur  http://public.activestate.com/pyxpcom/. Ce binding est depuis 2004 ou 2005 [intégré dans les sources de Mozilla|http://lxr.mozilla.org/seamonkey/source/extensions/python/].'
-                    =>'Le binding de Python, fut à l\'origine [[PyXpcom]], réalisé par Activestate et anciennement disponible sur  [[http://public.activestate.com/pyxpcom/]]. Ce binding est depuis 2004 ou 2005 [[http://lxr.mozilla.org/seamonkey/source/extensions/python/|intégré dans les sources de Mozilla]].',
-
-    );
-
-
-
-    function testBalisesInlineSimples() {
-        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
-        $k = 0;
-        foreach($this->listinline as $source=>$result){
-            $k++;
-            $res = $wr->render($source);
-            $this->assertEqualOrDiff($result, $res, "erreur on $k th test");
-            $this->assertEqual(count($wr->errors),0, "WR returns errors ! ".var_export($wr->errors,true)." (%s)");
-        }
-    }
-
-}
-if(!defined('ALL_TESTS')) {
-      $test = new phpwiki_dokuwiki_inlines();
-      $test->run(new HtmlReporter2());
-}

File tests/phpwiki_dokuwiki_inlinesTest.php

+<?php
+/**
+ * Unit tests for phpwiki to dokuwiki syntax conversion.
+ *
+ * inlines tags
+ *
+ * @package wikirenderer
+ * @subpackage tests
+ * @author Laurent Jouanneau
+ * @copyright 2009-2011 Laurent Jouanneau
+ */
+
+require_once(WR_DIR.'rules/phpwiki_to_dokuwiki.php');
+
+class phpwiki_dokuwiki_inlines extends PHPUnit_Framework_TestCase {
+
+    var $listinline = array(
+        'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
+        'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.',
+        'Lorem __ipsum dolor__ sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem **ipsum dolor** sit amet, consectetuer adipiscing elit.',
+        'Lorem __0__ sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem **0** sit amet, consectetuer adipiscing elit.',
+        'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.'
+                    =>'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.',
+        "Lorem ipsum dolor ''sit amet'', consectetuer adipiscing elit."
+                    =>'Lorem ipsum dolor //sit amet//, consectetuer adipiscing elit.',
+        'Lorem ipsum dolor sit amet, <sub>consectetuer</sub> adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, <sub>consectetuer</sub> adipiscing elit.',
+        'Lorem ipsum dolor sit amet, <sup>consectetuer</sup> adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, <sup>consectetuer</sup> adipiscing elit.',
+        'Lorem ipsum dolor sit amet, <del>consectetuer</del> adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, <del>consectetuer</del> adipiscing elit.',
+        'Lorem ipsum dolor sit amet, \\\\consectetuer adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, \\consectetuer adipiscing elit.',
+        'Lorem ipsum dolor sit amet, \\\\
+consectetuer adipiscing elit.'
+                    =>'Lorem ipsum dolor sit amet, \\
+consectetuer adipiscing elit.',
+
+        //---- links
+
+        'Lorem [ipsum dolor] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[ipsum dolor]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [#ipsum.dolor] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[#ipsum.dolor]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[http://foo.com|ipsum dolor]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [ipsum dolor|http://foo.com|bla|blo|bli] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[http://foo.com|ipsum dolor]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [[ipsum dolor|!http://foo.com] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.',
+        'Lorem [[ipsum dolor|http://foo.com] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [ipsum dolor|[[http://foo.com]]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [ ipsum dolor | javascript:alert(window.title)] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[javascript:alert(window.title)| ipsum dolor ]] sit amet, consectetuer adipiscing elit.',
+        'Lorem [[ipsumdolorsit amet], consectetuer adipiscing elit.'
+                    =>'Lorem [ipsumdolorsit amet], consectetuer adipiscing elit.',
+        'Lorem [[[[ipsumdolor sit amet], consectetuer adipiscing elit.'
+                    =>'Lorem [[ipsumdolor sit amet], consectetuer adipiscing elit.',
+        'Lorem [ipsumdolorsit amet], [[consectetuer] adipiscing elit.'
+                    =>'Lorem [[ipsumdolorsit amet]], [consectetuer] adipiscing elit.',
+        'Lorem IpsumDolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[IpsumDolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem IpsuméDolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[IpsuméDolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem IpsumDoloréSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[IpsumDoloréSit]] amet, consectetuer adipiscing elit.',
+        'Lorem !IpsumDolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem IpsumDolorSit amet, consectetuer adipiscing elit.',
+        'Lorem !!IpsumDolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem !IpsumDolorSit amet, consectetuer adipiscing elit.',
+        'Lorem [IpsumDolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[IpsumDolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem [Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[Ipsum:DolorSit|Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem [/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem [http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[http://flou.local/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem [[!http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.',
+        'Lorem [[http://flou.local/Ipsum/DolorSit] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[[http://flou.local/Ipsum/DolorSit]]] amet, consectetuer adipiscing elit.',
+        'Lorem http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[http://flou.local/Ipsum/DolorSit]] amet, consectetuer adipiscing elit.',
+        'Lorem !http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.'
+                    =>'Lorem http://flou.local/Ipsum/DolorSit amet, consectetuer adipiscing elit.',
+        'Lorem __http://flou.local/Ipsum/DolorSit amet__, consectetuer adipiscing elit.'
+                    =>'Lorem **[[http://flou.local/Ipsum/DolorSit]] amet**, consectetuer adipiscing elit.',
+        'Lorem [phpwiki:IpsumDolorSit?action=browse] amet, consectetuer adipiscing elit.'
+                    =>'Lorem [[IpsumDolorSit?]] amet, consectetuer adipiscing elit.',
+        'Lorem "http:" Ipsum Dolor Sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem "http:" Ipsum Dolor Sit amet, consectetuer adipiscing elit.',
+        'Lorem ipsum dolor[2] sit amet, consectetuer adipiscing elit.'
+                    =>'Lorem ipsum dolor[[!PWNOTE2!]] sit amet, consectetuer adipiscing elit.',
+
+        'Lorem [http://flou.local/Ipsum/DolorSit.png] amet, consectetuer adipiscing elit.'
+                    =>'Lorem {{http://flou.local/Ipsum/DolorSit.png}} amet, consectetuer adipiscing elit.',
+
+        'Lorem [ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
+                    =>'Lorem {{ipsumdolorsit.png}} amet, consectetuer adipiscing elit.',
+        'Lorem [alternative text|ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
+                    =>'Lorem {{ipsumdolorsit.png|alternative text}} amet, consectetuer adipiscing elit.',
+        'Lorem [ ipsumdolorsit.png] amet, consectetuer adipiscing elit.'
+                    =>'Lorem {{ ipsumdolorsit.png}} amet, consectetuer adipiscing elit.',
+
+
+        'Le binding de Python, fut à l\'origine PyXpcom, réalisé par Activestate et anciennement disponible sur  http://public.activestate.com/pyxpcom/. Ce binding est depuis 2004 ou 2005 [intégré dans les sources de Mozilla|http://lxr.mozilla.org/seamonkey/source/extensions/python/].'
+                    =>'Le binding de Python, fut à l\'origine [[PyXpcom]], réalisé par Activestate et anciennement disponible sur  [[http://public.activestate.com/pyxpcom/]]. Ce binding est depuis 2004 ou 2005 [[http://lxr.mozilla.org/seamonkey/source/extensions/python/|intégré dans les sources de Mozilla]].',
+
+    );
+
+
+
+    function testBalisesInlineSimples() {
+        $wr = new WikiRenderer(new phpwiki_to_dokuwiki());
+        $k = 0;
+        foreach($this->listinline as $source=>$result){
+            $k++;
+            $res = $wr->render($source);
+            $this->assertEquals($result, $res, "erreur on $k th test");
+            $this->assertEquals(0, count($wr->errors), "WR returns errors ! ".var_export($wr->errors,true));
+        }
+    }
+
+}
+