fonctions.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. #CACHE{0}
  2. <?php
  3. include_spip('inc/svp_outiller');
  4. include_spip('plugins/preparer_sql_plugin');
  5. echo '<h2>TESTS FONCTION normaliser_auteur_licence()</h2>';
  6. // ----------------------------------------------------------------
  7. echo '<h3>Balise auteur</h3>';
  8. $b = 'auteur';
  9. $t = 'Art libre, free art';
  10. echo '<strong>' . $t . '</strong><br />';
  11. var_dump(normaliser_auteur_licence($t, 'auteur'));
  12. $t = '[Art&#233;go->http://www.artego.fr], [C&#233;dric Morin->www.yterium.net]';
  13. echo '<strong>' . $t . '</strong><br />';
  14. var_dump(normaliser_auteur_licence($t, 'auteur'));
  15. $t = 'Jim';
  16. echo '<strong>' . $t . '</strong><br />';
  17. var_dump(normaliser_auteur_licence($t, 'auteur'));
  18. $t = '[Jim->http://www.tests.net]';
  19. echo '<strong>' . $t . '</strong><br />';
  20. var_dump(normaliser_auteur_licence($t, 'auteur'));
  21. $t = '[Jim / ateliers pouet->http://www.tests.net]';
  22. echo '<strong>' . $t . '</strong><br />';
  23. var_dump(normaliser_auteur_licence($t, 'auteur'));
  24. $t = '[Jim->Jim@toto.com]';
  25. echo '<strong>' . $t . '</strong><br />';
  26. var_dump(normaliser_auteur_licence($t, 'auteur'));
  27. $t = 'M&#233;dard, Jim, [Edouard Lafargue->mailto:edouard@lafargue.name]';
  28. echo '<strong>' . $t . '</strong><br />';
  29. var_dump(normaliser_auteur_licence($t, 'auteur'));
  30. $t = 'M&#233;dard, Jim GPL';
  31. echo '<strong>' . $t . '</strong><br />';
  32. var_dump(normaliser_auteur_licence($t, 'auteur'));
  33. $t = 'M&#233;dard, Jim GPL';
  34. echo '<strong>' . $t . '</strong><br />';
  35. var_dump(normaliser_auteur_licence($t, 'auteur'));
  36. $t = 'M&#233;dard, Jim - GPL - (c) 2001';
  37. echo '<strong>' . $t . '</strong><br />';
  38. var_dump(normaliser_auteur_licence($t, 'auteur'));
  39. $t = "M&#233;dard, Jim - GPL (c) 2001-2010, distribu&#233; MIT - Lucien [Roger->http://www.tests.net]";
  40. echo '<strong>' . $t . '</strong><br />';
  41. var_dump(normaliser_auteur_licence($t, 'auteur'));
  42. $t = "Camille Lafitte [Webelys->http://www.webelys.com], Cyril MARION [Ateliers CYM->http://www.cym.fr]";
  43. echo '<strong>' . $t . '</strong><br />';
  44. var_dump(normaliser_auteur_licence($t, 'auteur'));
  45. // ----------------------------------------------------------------
  46. echo '<h3>Balise licence</h3>';
  47. $b = 'licence';
  48. $t = '&#169; 2007 - GNU/GPL';
  49. echo '<strong>' . $t . '</strong><br />';
  50. var_dump(normaliser_auteur_licence($t, 'auteur'));
  51. echo '<h2>TESTS FONCTION compiler_branches_spip()</h2>';
  52. echo '<h3>Utilises, resultats incorrects, ecritures non valides -> a supprimer</h3>';
  53. echo '
  54. <table>
  55. <thead>
  56. <tr>
  57. <th>Intervalle</th>
  58. <th>Branches SPIP</th>
  59. </tr>
  60. </thead>
  61. <tbody>';
  62. echo '<tr><td>[2.0.0;2.3.0-dev)</td><td>' . compiler_branches_spip('[2.0.0;2.3.0-dev)') . '</td></tr>';
  63. echo '<tr><td>[2.0.0;3.1.0)</td><td>' . compiler_branches_spip('[2.0.0;3.1.0)') . '</td></tr>';
  64. echo '<tr><td>[2.0.0;3.1.0[</td><td>' . compiler_branches_spip('[2.0.0;3.1.0[') . '</td></tr>';
  65. echo '<tr><td>[2.0.3;2.2.0-dev]</td><td>' . compiler_branches_spip('[2.0.3;2.2.0-dev]') . '</td></tr>';
  66. echo '<tr><td>[2.0.3;3.1.0)</td><td>' . compiler_branches_spip('[2.0.3;3.1.0)') . '</td></tr>';
  67. echo '<tr><td>[2.1;3.1.0)</td><td>' . compiler_branches_spip('[2.1;3.1.0)') . '</td></tr>';
  68. echo '<tr><td>[2.1.0;2.2)</td><td>' . compiler_branches_spip('[2.1.0;2.2)') . '</td></tr>';
  69. echo '<tr><td>[2.1.0;2.3.0-dev)</td><td>' . compiler_branches_spip('[2.1.0;2.3.0-dev)') . '</td></tr>';
  70. echo '<tr><td>[2.0.9;3.1.0)</td><td>' . compiler_branches_spip('[2.0.9;3.1.0)') . '</td></tr>';
  71. echo '<tr><td>[2.2.0-dev;]</td><td>' . compiler_branches_spip('[2.2.0-dev;]') . '</td></tr>';
  72. echo '<tr><td>[1.9207;]</td><td>' . compiler_branches_spip('[1.9207;]') . '</td></tr>';
  73. echo '<tr><td>[;1.925)</td><td>' . compiler_branches_spip('[;1.925)') . '</td></tr>';
  74. echo '
  75. </tbody>
  76. </table>';
  77. echo '<h3>Utilises, resultats corrects mais ecritures non valides -> a supprimer</h3>';
  78. echo '
  79. <table>
  80. <thead>
  81. <tr>
  82. <th>Intervalle</th>
  83. <th>Branches SPIP</th>
  84. </tr>
  85. </thead>
  86. <tbody>';
  87. echo '<tr><td>[1.9.2x;)</td><td>' . compiler_branches_spip('[1.9.2x;)') . '</td></tr>';
  88. echo '<tr><td>[1.9.3;]</td><td>' . compiler_branches_spip('[1.9.3;]') . '</td></tr>';
  89. echo '<tr><td>[2.1 dev;]</td><td>' . compiler_branches_spip('[2.1 dev;]') . '</td></tr>';
  90. echo '<tr><td>[2.1.0 dev;)</td><td>' . compiler_branches_spip('[2.1.0 dev;)') . '</td></tr>';
  91. echo '<tr><td>[1.9.0;2.0.99]</td><td>' . compiler_branches_spip('[1.9.0;2.0.99]') . '</td></tr>';
  92. echo '<tr><td>[1.9.2;1.9.3]</td><td>' . compiler_branches_spip('[1.9.2;1.9.3]') . '</td></tr>';
  93. echo '
  94. </tbody>
  95. </table>';
  96. echo '<h3>Non utilises et valides</h3>';
  97. echo '
  98. <table>
  99. <thead>
  100. <tr>
  101. <th>Intervalle</th>
  102. <th>Branches SPIP</th>
  103. </tr>
  104. </thead>
  105. <tbody>';
  106. echo '<tr><td>(1.9.0;1.9.2]</td><td>' . compiler_branches_spip('(1.9.0;1.9.2]') . '</td></tr>';
  107. echo '<tr><td>(1.9.0;2.1.9]</td><td>' . compiler_branches_spip('(1.9.0;2.1.9]') . '</td></tr>';
  108. echo '<tr><td>(1.9.0;2.1.9)</td><td>' . compiler_branches_spip('(1.9.0;2.1.9)') . '</td></tr>';
  109. echo '<tr><td>(1.9.0;2.1)</td><td>' . compiler_branches_spip('(1.9.0;2.1)') . '</td></tr>';
  110. echo '<tr><td>(1.9.0;)</td><td>' . compiler_branches_spip('(1.9.0;)') . '</td></tr>';
  111. echo '
  112. </tbody>
  113. </table>';
  114. echo '<h3>Utilises et valides</h3>';
  115. echo '
  116. <table>
  117. <thead>
  118. <tr>
  119. <th>Intervalle</th>
  120. <th>Branches SPIP</th>
  121. </tr>
  122. </thead>
  123. <tbody>';
  124. echo '<tr><td>[;]</td><td>' . compiler_branches_spip('[;]') . '</td></tr>';
  125. echo '<tr><td>[1.9.0;1.9.1)</td><td>' . compiler_branches_spip('[1.9.0;1.9.1)') . '</td></tr>';
  126. echo '<tr><td>[1.9.0;[</td><td>' . compiler_branches_spip('[1.9.0;[') . '</td></tr>';
  127. echo '<tr><td>[1.9.2;3.0.0-dev[</td><td>' . compiler_branches_spip('[1.9.2;3.0.0-dev[') . '</td></tr>';
  128. echo '<tr><td>[1.9.0;1.9.2]</td><td>' . compiler_branches_spip('[1.9.0;1.9.2]') . '</td></tr>';
  129. echo '<tr><td>[1.9.0;2.0.0)</td><td>' . compiler_branches_spip('[1.9.0;2.0.0)') . '</td></tr>';
  130. echo '<tr><td>[1.9.0;2.0.0]</td><td>' . compiler_branches_spip('[1.9.0;2.0.0]') . '</td></tr>';
  131. echo '<tr><td>[1.9.0;3.0.0]</td><td>' . compiler_branches_spip('[1.9.0;3.0.0]') . '</td></tr>';
  132. echo '<tr><td>[1.9.0;]</td><td>' . compiler_branches_spip('[1.9.0;]') . '</td></tr>';
  133. echo '<tr><td>[1.9.1;1.9.2]</td><td>' . compiler_branches_spip('[1.9.1;1.9.2]') . '</td></tr>';
  134. echo '<tr><td>[1.9.1;3.0.0]</td><td>' . compiler_branches_spip('[1.9.1;3.0.0]') . '</td></tr>';
  135. echo '<tr><td>[1.9.1;]</td><td>' . compiler_branches_spip('[1.9.1;]') . '</td></tr>';
  136. echo '<tr><td>[1.9.2;1.9.2]</td><td>' . compiler_branches_spip('[1.9.2;1.9.2]') . '</td></tr>';
  137. echo '<tr><td>[1.9.2;2.0.0)</td><td>' . compiler_branches_spip('[1.9.2;2.0.0)') . '</td></tr>';
  138. echo '<tr><td>[1.9.2;3.0.0-dev[</td><td>' . compiler_branches_spip('[1.9.2;3.0.0-dev[') . '</td></tr>';
  139. echo '<tr><td>[1.9.2;]</td><td>' . compiler_branches_spip('[1.9.2;]') . '</td></tr>';
  140. echo '<tr><td>[2.0.0;3.0.0]</td><td>' . compiler_branches_spip('[2.0.0;3.0.0]') . '</td></tr>';
  141. echo '<tr><td>[2.0.0;[</td><td>' . compiler_branches_spip('[2.0.0;[') . '</td></tr>';
  142. echo '<tr><td>[2.0.0;]</td><td>' . compiler_branches_spip('[2.0.0;]') . '</td></tr>';
  143. echo '<tr><td>[2.0.10;2.1)</td><td>' . compiler_branches_spip('[2.0.10;2.1)') . '</td></tr>';
  144. echo '<tr><td>[2.0.10;3.0.*]</td><td>' . compiler_branches_spip('[2.0.10;3.0.*]') . '</td></tr>';
  145. echo '<tr><td>[2.0.10;3.0.0-dev)</td><td>' . compiler_branches_spip('[2.0.10;3.0.0-dev)') . '</td></tr>';
  146. echo '<tr><td>[2.0.10;[</td><td>' . compiler_branches_spip('[2.0.10;[') . '</td></tr>';
  147. echo '<tr><td>[2.0.10;]</td><td>' . compiler_branches_spip('[2.0.10;]') . '</td></tr>';
  148. echo '<tr><td>[2.0.12;]</td><td>' . compiler_branches_spip('[2.0.12;]') . '</td></tr>';
  149. echo '<tr><td>[2.0.14;]</td><td>' . compiler_branches_spip('[2.0.14;]') . '</td></tr>';
  150. echo '<tr><td>[2.0.2;]</td><td>' . compiler_branches_spip('[2.0.2;]') . '</td></tr>';
  151. echo '<tr><td>[2.0.3;[</td><td>' . compiler_branches_spip('[2.0.3;[') . '</td></tr>';
  152. echo '<tr><td>[2.0.3;]</td><td>' . compiler_branches_spip('[2.0.3;]') . '</td></tr>';
  153. echo '<tr><td>[2.0.6;]</td><td>' . compiler_branches_spip('[2.0.6;]') . '</td></tr>';
  154. echo '<tr><td>[2.0.8;[</td><td>' . compiler_branches_spip('[2.0.8;[') . '</td></tr>';
  155. echo '<tr><td>[2.0.8;]</td><td>' . compiler_branches_spip('[2.0.8;]') . '</td></tr>';
  156. echo '<tr><td>[2.0.9;3.0.0]</td><td>' . compiler_branches_spip('[2.0.9;3.0.0]') . '</td></tr>';
  157. echo '<tr><td>[2.0.9;]</td><td>' . compiler_branches_spip('[2.0.9;]') . '</td></tr>';
  158. echo '<tr><td>[2.0;)</td><td>' . compiler_branches_spip('[2.0;)') . '</td></tr>';
  159. echo '<tr><td>[2.0;3.0.0]</td><td>' . compiler_branches_spip('[2.0;3.0.0]') . '</td></tr>';
  160. echo '<tr><td>[2.0;[</td><td>' . compiler_branches_spip('[2.0;[') . '</td></tr>';
  161. echo '<tr><td>[2.0;]</td><td>' . compiler_branches_spip('[2.0;]') . '</td></tr>';
  162. echo '<tr><td>[2.1.0-beta;]</td><td>' . compiler_branches_spip('[2.1.0-beta;]') . '</td></tr>';
  163. echo '<tr><td>[2.1.0-dev;)</td><td>' . compiler_branches_spip('[2.1.0-dev;)') . '</td></tr>';
  164. echo '<tr><td>[2.1.0;3.0.0-dev)</td><td>' . compiler_branches_spip('[2.1.0;3.0.0-dev)') . '</td></tr>';
  165. echo '<tr><td>[2.1.0;3.0.0]</td><td>' . compiler_branches_spip('[2.1.0;3.0.0]') . '</td></tr>';
  166. echo '<tr><td>[2.1.0;]</td><td>' . compiler_branches_spip('[2.1.0;]') . '</td></tr>';
  167. echo '<tr><td>[2.1.10;)</td><td>' . compiler_branches_spip('[2.1.10;)') . '</td></tr>';
  168. echo '<tr><td>[2.1.10;]</td><td>' . compiler_branches_spip('[2.1.10;]') . '</td></tr>';
  169. echo '<tr><td>[2.1.1;]</td><td>' . compiler_branches_spip('[2.1.1;]') . '</td></tr>';
  170. echo '<tr><td>[2.1.2;]</td><td>' . compiler_branches_spip('[2.1.2;]') . '</td></tr>';
  171. echo '<tr><td>[2.1.6;]</td><td>' . compiler_branches_spip('[2.1.6;]') . '</td></tr>';
  172. echo '<tr><td>[2.1.8;]</td><td>' . compiler_branches_spip('[2.1.8;]') . '</td></tr>';
  173. echo '<tr><td>[2.1;)</td><td>' . compiler_branches_spip('[2.1;)') . '</td></tr>';
  174. echo '<tr><td>[2.1;3.0.0-dev)</td><td>' . compiler_branches_spip('[2.1;3.0.0-dev)') . '</td></tr>';
  175. echo '<tr><td>[2.1;]</td><td>' . compiler_branches_spip('[2.1;]') . '</td></tr>';
  176. echo '<tr><td>[3.0.0-dev;]</td><td>' . compiler_branches_spip('[3.0.0-dev;]') . '</td></tr>';
  177. echo '<tr><td>vide</td><td>' . compiler_branches_spip('') . '</td></tr>';
  178. echo '
  179. </tbody>
  180. </table>';
  181. ?>