@@ -13,19 +13,19 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class SpipXmlParseTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('inc/xml.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('inc/xml.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - #[DataProvider('providerXmlSpipXmlParse')] |
|
| 21 | - public function testXmlSpipXmlParse($expected, ...$args): void { |
|
| 22 | - $actual = serialize(spip_xml_parse(...$args)); |
|
| 23 | - $this->assertSame($expected, $actual); |
|
| 24 | - } |
|
| 20 | + #[DataProvider('providerXmlSpipXmlParse')] |
|
| 21 | + public function testXmlSpipXmlParse($expected, ...$args): void { |
|
| 22 | + $actual = serialize(spip_xml_parse(...$args)); |
|
| 23 | + $this->assertSame($expected, $actual); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public static function providerXmlSpipXmlParse(): array { |
|
| 27 | - $essais = []; |
|
| 28 | - $xml1 = '<' . <<<CODE_SAMPLE |
|
| 26 | + public static function providerXmlSpipXmlParse(): array { |
|
| 27 | + $essais = []; |
|
| 28 | + $xml1 = '<' . <<<CODE_SAMPLE |
|
| 29 | 29 | ?xml version="1.0" encoding="utf-8"?> |
| 30 | 30 | <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> |
| 31 | 31 | <url><loc>http://localhost/_core/spip/spip.php?breve25</loc> |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | </url> |
| 45 | 45 | </urlset> |
| 46 | 46 | CODE_SAMPLE; |
| 47 | - $tree1 = <<<CODE_SAMPLE |
|
| 47 | + $tree1 = <<<CODE_SAMPLE |
|
| 48 | 48 | a:1:{s:57:"urlset xmlns="http://www.google.com/schemas/sitemap/0.84"";a:1:{i:0;a:1:{s:3:"url";a:3:{i:0;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve25";}s:7:"lastmod";a:1:{i:0;s:10:"2003-12-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:1;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve32";}s:7:"lastmod";a:1:{i:0;s:10:"2004-02-10";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:2;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve64";}s:7:"lastmod";a:1:{i:0;s:10:"2005-01-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}}}}} |
| 49 | 49 | CODE_SAMPLE; |
| 50 | - $xml2 = '<' . <<<CODE_SAMPLE |
|
| 50 | + $xml2 = '<' . <<<CODE_SAMPLE |
|
| 51 | 51 | ?xml version="1.0" encoding="UTF-8"?> |
| 52 | 52 | <opml version="1.0"> |
| 53 | 53 | <head> |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | </body> |
| 105 | 105 | </opml> |
| 106 | 106 | CODE_SAMPLE; |
| 107 | - $tree2 = <<<CODE_SAMPLE |
|
| 107 | + $tree2 = <<<CODE_SAMPLE |
|
| 108 | 108 | a:1:{s:18:"opml version="1.0"";a:1:{i:0;a:2:{s:4:"head";a:1:{i:0;a:2:{s:5:"title";a:1:{i:0;s:9:"arbo_riec";}s:14:"expansionState";a:1:{i:0;s:93:"0,9,14,24,28,30,31,35,41,43,44,46,48,55,58,61,66,71,74,77,78,82,87,89,90,92,96,98,102,110,112";}}}s:4:"body";a:1:{i:0;a:3:{s:27:"outline text="Citoyenneté"";a:1:{i:0;a:8:{s:98:"outline text="Page d'accueil" Contenu="Articles et brèves d'actualité + Vos questions en direct"";a:1:{i:0;s:0:"";}s:152:"outline text="Le maire et les adjoints" Contenu="Nom, fonction, contact, horaires de permanence et photo de chaque élu" Fonctionnalité="Trombinoscope"";a:1:{i:0;s:0:"";}s:88:"outline text="Les conseillers municipaux" Contenu="idem" Fonctionnalité="Trombinoscope"";a:1:{i:0;s:0:"";}s:81:"outline text="Les commissions" Contenu="Présentation générale des commissions"";a:1:{i:0;a:1:{s:83:"outline text="Une fiche par commission" Contenu="Domaine de compétence et membres"";a:1:{i:0;s:0:"";}}}s:173:"outline text="Les conseils municipaux" Contenu="Présentation générale, téléchargement du dernier compte-rendu et agenda des prochains conseils" Fonctionnalité="Agenda"";a:1:{i:0;a:1:{s:136:"outline text="Comptes-rendus" Contenu="Les comptes-rendus de conseils à télécharger" Fonctionnalité="Publications et archivage auto"";a:1:{i:0;a:1:{s:82:"outline text="Un article par compte-rendu" Contenu="Texte ou doc à télécharger"";a:1:{i:0;s:0:"";}}}}}s:113:"outline text="Les réunions de quartier" Contenu="Présentation et agenda des réunions" Fonctionnalité="Agenda"";a:1:{i:0;s:0:"";}s:83:"outline text="L’Atelier municipal sur l’environnement" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:78:"outline text="L’intercommunalité" Contenu="Texte de présentation + photos"";a:1:{i:0;a:5:{s:47:"outline text="Cocopaq" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:71:"outline text="Syndicat de Voirie de Rosporden" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:63:"outline text="SIVU de Riec sur Bélon" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:45:"outline text="Sicom" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:100:"outline text="Syndicat d’eau et d’électricification de Riec sur Belon" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}}}}}s:23:"outline text="Economie"";a:1:{i:0;a:9:{s:83:"outline text="Page d'accueil" Contenu="Actualité + lien vers les marchés publics"";a:1:{i:0;s:0:"";}s:74:"outline text="Marchés publics" Contenu="Texte de présentation + contact"";a:1:{i:0;a:2:{s:131:"outline text="Avis d'attribution" Contenu="Texte accueil et affichage des derniers avis" Fonctionnalité="Publications + archivage"";a:1:{i:0;a:1:{s:74:"outline text="Un article par avis" Contenu="Texte ou doc à télécharger"";a:1:{i:0;s:0:"";}}}s:113:"outline text="Avis de publicité" Contenu="Texte + affichage des avis en cours" Fonctionnalité="Marchés public"";a:1:{i:0;a:1:{s:495:"outline text="Un article par avis" Contenu="Texte + docs à télécharger" Fonctionnalité="Un formulaire invite le visiteur à fournir son adresse email. Un email lui est alors automatiquement expédié qui contient un lien. En cliquant sur ce lien, le visiteur revient sur la page mais cette fois il a la possibilité de télécharger les pièces jointes à l'avis. Les mails sont ainsi collectés et ceux qui ont téléchargé les pièces peuvent ainsi être contactés en cas de changement."";a:1:{i:0;s:0:"";}}}}}s:37:"outline text="Les atouts de la ville"";a:1:{i:0;a:2:{s:62:"outline text="Production ostréicole" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:133:"outline text="Situation géographique" Contenu="Même contenu que dans La Ville ?" Fonctionnalité="modèle de duplication d'article"";a:1:{i:0;s:0:"";}}}s:53:"outline text="S’implanter" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:47:"outline text="Le GAER" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}s:136:"outline text="Les commerces" Contenu="Présentation + formulaire d'inscription à l'annuaire" Fonctionnalité="Fonctionnalité annuaire"";a:1:{i:0;s:0:"";}s:138:"outline text="Les entreprises" Contenu="Présentation + formulaire d'inscription à l'annuaire" Fonctionnalité="Fonctionnalité annuaire"";a:1:{i:0;s:0:"";}s:105:"outline text="Les ZA et ZI" Contenu="Présentation + carte des ZA-ZI" Fonctionnalité="Carte interactive"";a:1:{i:0;a:1:{s:87:"outline text="Une page par zone" Contenu="Fiche de présentation + photo + plan accès"";a:1:{i:0;s:0:"";}}}s:50:"outline text="Le marché" Contenu="Texte + photos"";a:1:{i:0;s:0:"";}}}s:40:"outline text="Tourisme version anglaise"";a:1:{i:0;s:0:"";}}}}}} |
| 109 | 109 | CODE_SAMPLE; |
| 110 | - $essais['sitemap'] = [$tree1, $xml1]; |
|
| 111 | - $essais['opml'] = [$tree2, $xml2]; |
|
| 112 | - return $essais; |
|
| 113 | - } |
|
| 110 | + $essais['sitemap'] = [$tree1, $xml1]; |
|
| 111 | + $essais['opml'] = [$tree2, $xml2]; |
|
| 112 | + return $essais; |
|
| 113 | + } |
|
| 114 | 114 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public static function providerXmlSpipXmlParse(): array { |
| 27 | 27 | $essais = []; |
| 28 | - $xml1 = '<' . <<<CODE_SAMPLE |
|
| 28 | + $xml1 = '<'.<<<CODE_SAMPLE |
|
| 29 | 29 | ?xml version="1.0" encoding="utf-8"?> |
| 30 | 30 | <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> |
| 31 | 31 | <url><loc>http://localhost/_core/spip/spip.php?breve25</loc> |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $tree1 = <<<CODE_SAMPLE |
| 48 | 48 | a:1:{s:57:"urlset xmlns="http://www.google.com/schemas/sitemap/0.84"";a:1:{i:0;a:1:{s:3:"url";a:3:{i:0;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve25";}s:7:"lastmod";a:1:{i:0;s:10:"2003-12-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:1;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve32";}s:7:"lastmod";a:1:{i:0;s:10:"2004-02-10";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:2;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve64";}s:7:"lastmod";a:1:{i:0;s:10:"2005-01-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}}}}} |
| 49 | 49 | CODE_SAMPLE; |
| 50 | - $xml2 = '<' . <<<CODE_SAMPLE |
|
| 50 | + $xml2 = '<'.<<<CODE_SAMPLE |
|
| 51 | 51 | ?xml version="1.0" encoding="UTF-8"?> |
| 52 | 52 | <opml version="1.0"> |
| 53 | 53 | <head> |
@@ -9,497 +9,497 @@ |
||
| 9 | 9 | |
| 10 | 10 | class SuivreLienTest extends TestCase |
| 11 | 11 | { |
| 12 | - public static function setUpBeforeClass(): void |
|
| 13 | - { |
|
| 14 | - find_in_path('./inc/utils.php', '', true); |
|
| 15 | - } |
|
| 12 | + public static function setUpBeforeClass(): void |
|
| 13 | + { |
|
| 14 | + find_in_path('./inc/utils.php', '', true); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - #[DataProvider('providerSuivreLien')] |
|
| 18 | - public function testSuivreLien($expected, ...$args): void |
|
| 19 | - { |
|
| 20 | - $actual = suivre_lien(...$args); |
|
| 21 | - $this->assertSame($expected, $actual); |
|
| 22 | - } |
|
| 17 | + #[DataProvider('providerSuivreLien')] |
|
| 18 | + public function testSuivreLien($expected, ...$args): void |
|
| 19 | + { |
|
| 20 | + $actual = suivre_lien(...$args); |
|
| 21 | + $this->assertSame($expected, $actual); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public static function providerSuivreLien(): array |
|
| 25 | - { |
|
| 26 | - return [ |
|
| 27 | - [ |
|
| 28 | - 'http://tata/', |
|
| 29 | - 'http://host/', |
|
| 30 | - 'http://tata/', |
|
| 31 | - ], |
|
| 32 | - [ |
|
| 33 | - 'http://tata/', |
|
| 34 | - '//host/', |
|
| 35 | - 'http://tata/', |
|
| 36 | - ], |
|
| 37 | - [ |
|
| 38 | - '//tata/', |
|
| 39 | - 'http://host/', |
|
| 40 | - '//tata/', |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'http://host/tata/', |
|
| 44 | - 'http://host/', |
|
| 45 | - '/tata/', |
|
| 46 | - ], |
|
| 47 | - [ |
|
| 48 | - '//host/tata/', |
|
| 49 | - '//host/', |
|
| 50 | - '/tata/', |
|
| 51 | - ], |
|
| 52 | - [ |
|
| 53 | - 'http://host/#tata', |
|
| 54 | - 'http://host/', |
|
| 55 | - '#tata', |
|
| 56 | - ], |
|
| 57 | - [ |
|
| 58 | - '//host/#tata', |
|
| 59 | - '//host/', |
|
| 60 | - '#tata', |
|
| 61 | - ], |
|
| 62 | - [ |
|
| 63 | - 'http://host/', |
|
| 64 | - 'http://host/', |
|
| 65 | - '', |
|
| 66 | - ], |
|
| 67 | - [ |
|
| 68 | - '//host/', |
|
| 69 | - '//host/', |
|
| 70 | - '', |
|
| 71 | - ], |
|
| 72 | - [ |
|
| 73 | - 'http://host/tata', |
|
| 74 | - 'http://host/', |
|
| 75 | - 'tata', |
|
| 76 | - ], |
|
| 77 | - [ |
|
| 78 | - '//host/tata', |
|
| 79 | - '//host/', |
|
| 80 | - 'tata', |
|
| 81 | - ], |
|
| 82 | - [ |
|
| 83 | - 'http://host/?par=value', |
|
| 84 | - 'http://host/', |
|
| 85 | - '?par=value', |
|
| 86 | - ], |
|
| 87 | - [ |
|
| 88 | - '//host/?par=value', |
|
| 89 | - '//host/', |
|
| 90 | - '?par=value', |
|
| 91 | - ], |
|
| 92 | - [ |
|
| 93 | - 'http://host/tata?par=value', |
|
| 94 | - 'http://host/', |
|
| 95 | - 'tata?par=value', |
|
| 96 | - ], |
|
| 97 | - [ |
|
| 98 | - '//host/tata?par=value', |
|
| 99 | - '//host/', |
|
| 100 | - 'tata?par=value', |
|
| 101 | - ], |
|
| 102 | - [ |
|
| 103 | - 'http://host/tata#ancre', |
|
| 104 | - 'http://host/', |
|
| 105 | - 'tata#ancre', |
|
| 106 | - ], |
|
| 107 | - [ |
|
| 108 | - '//host/tata#ancre', |
|
| 109 | - '//host/', |
|
| 110 | - 'tata#ancre', |
|
| 111 | - ], |
|
| 112 | - [ |
|
| 113 | - 'http://host/tata?par=value#ancre', |
|
| 114 | - 'http://host/', |
|
| 115 | - 'tata?par=value#ancre', |
|
| 116 | - ], |
|
| 117 | - [ |
|
| 118 | - '//host/tata?par=value#ancre', |
|
| 119 | - '//host/', |
|
| 120 | - 'tata?par=value#ancre', |
|
| 121 | - ], |
|
| 24 | + public static function providerSuivreLien(): array |
|
| 25 | + { |
|
| 26 | + return [ |
|
| 27 | + [ |
|
| 28 | + 'http://tata/', |
|
| 29 | + 'http://host/', |
|
| 30 | + 'http://tata/', |
|
| 31 | + ], |
|
| 32 | + [ |
|
| 33 | + 'http://tata/', |
|
| 34 | + '//host/', |
|
| 35 | + 'http://tata/', |
|
| 36 | + ], |
|
| 37 | + [ |
|
| 38 | + '//tata/', |
|
| 39 | + 'http://host/', |
|
| 40 | + '//tata/', |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'http://host/tata/', |
|
| 44 | + 'http://host/', |
|
| 45 | + '/tata/', |
|
| 46 | + ], |
|
| 47 | + [ |
|
| 48 | + '//host/tata/', |
|
| 49 | + '//host/', |
|
| 50 | + '/tata/', |
|
| 51 | + ], |
|
| 52 | + [ |
|
| 53 | + 'http://host/#tata', |
|
| 54 | + 'http://host/', |
|
| 55 | + '#tata', |
|
| 56 | + ], |
|
| 57 | + [ |
|
| 58 | + '//host/#tata', |
|
| 59 | + '//host/', |
|
| 60 | + '#tata', |
|
| 61 | + ], |
|
| 62 | + [ |
|
| 63 | + 'http://host/', |
|
| 64 | + 'http://host/', |
|
| 65 | + '', |
|
| 66 | + ], |
|
| 67 | + [ |
|
| 68 | + '//host/', |
|
| 69 | + '//host/', |
|
| 70 | + '', |
|
| 71 | + ], |
|
| 72 | + [ |
|
| 73 | + 'http://host/tata', |
|
| 74 | + 'http://host/', |
|
| 75 | + 'tata', |
|
| 76 | + ], |
|
| 77 | + [ |
|
| 78 | + '//host/tata', |
|
| 79 | + '//host/', |
|
| 80 | + 'tata', |
|
| 81 | + ], |
|
| 82 | + [ |
|
| 83 | + 'http://host/?par=value', |
|
| 84 | + 'http://host/', |
|
| 85 | + '?par=value', |
|
| 86 | + ], |
|
| 87 | + [ |
|
| 88 | + '//host/?par=value', |
|
| 89 | + '//host/', |
|
| 90 | + '?par=value', |
|
| 91 | + ], |
|
| 92 | + [ |
|
| 93 | + 'http://host/tata?par=value', |
|
| 94 | + 'http://host/', |
|
| 95 | + 'tata?par=value', |
|
| 96 | + ], |
|
| 97 | + [ |
|
| 98 | + '//host/tata?par=value', |
|
| 99 | + '//host/', |
|
| 100 | + 'tata?par=value', |
|
| 101 | + ], |
|
| 102 | + [ |
|
| 103 | + 'http://host/tata#ancre', |
|
| 104 | + 'http://host/', |
|
| 105 | + 'tata#ancre', |
|
| 106 | + ], |
|
| 107 | + [ |
|
| 108 | + '//host/tata#ancre', |
|
| 109 | + '//host/', |
|
| 110 | + 'tata#ancre', |
|
| 111 | + ], |
|
| 112 | + [ |
|
| 113 | + 'http://host/tata?par=value#ancre', |
|
| 114 | + 'http://host/', |
|
| 115 | + 'tata?par=value#ancre', |
|
| 116 | + ], |
|
| 117 | + [ |
|
| 118 | + '//host/tata?par=value#ancre', |
|
| 119 | + '//host/', |
|
| 120 | + 'tata?par=value#ancre', |
|
| 121 | + ], |
|
| 122 | 122 | |
| 123 | - [ |
|
| 124 | - 'http://tata/', |
|
| 125 | - 'http://host/page', |
|
| 126 | - 'http://tata/', |
|
| 127 | - ], |
|
| 128 | - [ |
|
| 129 | - 'http://tata/', |
|
| 130 | - '//host/page', |
|
| 131 | - 'http://tata/', |
|
| 132 | - ], |
|
| 133 | - [ |
|
| 134 | - '//tata/', |
|
| 135 | - 'http://host/page', |
|
| 136 | - '//tata/', |
|
| 137 | - ], |
|
| 138 | - [ |
|
| 139 | - 'http://host/tata/', |
|
| 140 | - 'http://host/page', |
|
| 141 | - '/tata/', |
|
| 142 | - ], |
|
| 143 | - [ |
|
| 144 | - '//host/tata/', |
|
| 145 | - '//host/page', |
|
| 146 | - '/tata/', |
|
| 147 | - ], |
|
| 148 | - [ |
|
| 149 | - 'http://host/page#tata', |
|
| 150 | - 'http://host/page', |
|
| 151 | - '#tata', |
|
| 152 | - ], |
|
| 153 | - [ |
|
| 154 | - '//host/page#tata', |
|
| 155 | - '//host/page', |
|
| 156 | - '#tata', |
|
| 157 | - ], |
|
| 158 | - [ |
|
| 159 | - 'http://host/page', |
|
| 160 | - 'http://host/page', |
|
| 161 | - '', |
|
| 162 | - ], |
|
| 163 | - [ |
|
| 164 | - '//host/page', |
|
| 165 | - '//host/page', |
|
| 166 | - '', |
|
| 167 | - ], |
|
| 168 | - [ |
|
| 169 | - 'http://host/tata', |
|
| 170 | - 'http://host/page', |
|
| 171 | - 'tata', |
|
| 172 | - ], |
|
| 173 | - [ |
|
| 174 | - '//host/tata', |
|
| 175 | - '//host/page', |
|
| 176 | - 'tata', |
|
| 177 | - ], |
|
| 178 | - [ |
|
| 179 | - 'http://host/?par=value', |
|
| 180 | - 'http://host/page', |
|
| 181 | - '?par=value', |
|
| 182 | - ], |
|
| 183 | - [ |
|
| 184 | - '//host/?par=value', |
|
| 185 | - '//host/page', |
|
| 186 | - '?par=value', |
|
| 187 | - ], |
|
| 188 | - [ |
|
| 189 | - 'http://host/tata?par=value', |
|
| 190 | - 'http://host/page', |
|
| 191 | - 'tata?par=value', |
|
| 192 | - ], |
|
| 193 | - [ |
|
| 194 | - '//host/tata?par=value', |
|
| 195 | - '//host/page', |
|
| 196 | - 'tata?par=value', |
|
| 197 | - ], |
|
| 198 | - [ |
|
| 199 | - 'http://host/tata#ancre', |
|
| 200 | - 'http://host/page', |
|
| 201 | - 'tata#ancre', |
|
| 202 | - ], |
|
| 203 | - [ |
|
| 204 | - '//host/tata#ancre', |
|
| 205 | - '//host/page', |
|
| 206 | - 'tata#ancre', |
|
| 207 | - ], |
|
| 208 | - [ |
|
| 209 | - 'http://host/tata?par=value#ancre', |
|
| 210 | - 'http://host/page', |
|
| 211 | - 'tata?par=value#ancre', |
|
| 212 | - ], |
|
| 213 | - [ |
|
| 214 | - '//host/tata?par=value#ancre', |
|
| 215 | - '//host/page', |
|
| 216 | - 'tata?par=value#ancre', |
|
| 217 | - ], |
|
| 123 | + [ |
|
| 124 | + 'http://tata/', |
|
| 125 | + 'http://host/page', |
|
| 126 | + 'http://tata/', |
|
| 127 | + ], |
|
| 128 | + [ |
|
| 129 | + 'http://tata/', |
|
| 130 | + '//host/page', |
|
| 131 | + 'http://tata/', |
|
| 132 | + ], |
|
| 133 | + [ |
|
| 134 | + '//tata/', |
|
| 135 | + 'http://host/page', |
|
| 136 | + '//tata/', |
|
| 137 | + ], |
|
| 138 | + [ |
|
| 139 | + 'http://host/tata/', |
|
| 140 | + 'http://host/page', |
|
| 141 | + '/tata/', |
|
| 142 | + ], |
|
| 143 | + [ |
|
| 144 | + '//host/tata/', |
|
| 145 | + '//host/page', |
|
| 146 | + '/tata/', |
|
| 147 | + ], |
|
| 148 | + [ |
|
| 149 | + 'http://host/page#tata', |
|
| 150 | + 'http://host/page', |
|
| 151 | + '#tata', |
|
| 152 | + ], |
|
| 153 | + [ |
|
| 154 | + '//host/page#tata', |
|
| 155 | + '//host/page', |
|
| 156 | + '#tata', |
|
| 157 | + ], |
|
| 158 | + [ |
|
| 159 | + 'http://host/page', |
|
| 160 | + 'http://host/page', |
|
| 161 | + '', |
|
| 162 | + ], |
|
| 163 | + [ |
|
| 164 | + '//host/page', |
|
| 165 | + '//host/page', |
|
| 166 | + '', |
|
| 167 | + ], |
|
| 168 | + [ |
|
| 169 | + 'http://host/tata', |
|
| 170 | + 'http://host/page', |
|
| 171 | + 'tata', |
|
| 172 | + ], |
|
| 173 | + [ |
|
| 174 | + '//host/tata', |
|
| 175 | + '//host/page', |
|
| 176 | + 'tata', |
|
| 177 | + ], |
|
| 178 | + [ |
|
| 179 | + 'http://host/?par=value', |
|
| 180 | + 'http://host/page', |
|
| 181 | + '?par=value', |
|
| 182 | + ], |
|
| 183 | + [ |
|
| 184 | + '//host/?par=value', |
|
| 185 | + '//host/page', |
|
| 186 | + '?par=value', |
|
| 187 | + ], |
|
| 188 | + [ |
|
| 189 | + 'http://host/tata?par=value', |
|
| 190 | + 'http://host/page', |
|
| 191 | + 'tata?par=value', |
|
| 192 | + ], |
|
| 193 | + [ |
|
| 194 | + '//host/tata?par=value', |
|
| 195 | + '//host/page', |
|
| 196 | + 'tata?par=value', |
|
| 197 | + ], |
|
| 198 | + [ |
|
| 199 | + 'http://host/tata#ancre', |
|
| 200 | + 'http://host/page', |
|
| 201 | + 'tata#ancre', |
|
| 202 | + ], |
|
| 203 | + [ |
|
| 204 | + '//host/tata#ancre', |
|
| 205 | + '//host/page', |
|
| 206 | + 'tata#ancre', |
|
| 207 | + ], |
|
| 208 | + [ |
|
| 209 | + 'http://host/tata?par=value#ancre', |
|
| 210 | + 'http://host/page', |
|
| 211 | + 'tata?par=value#ancre', |
|
| 212 | + ], |
|
| 213 | + [ |
|
| 214 | + '//host/tata?par=value#ancre', |
|
| 215 | + '//host/page', |
|
| 216 | + 'tata?par=value#ancre', |
|
| 217 | + ], |
|
| 218 | 218 | |
| 219 | - [ |
|
| 220 | - 'http://tata/', |
|
| 221 | - 'http://host/rep/page', |
|
| 222 | - 'http://tata/', |
|
| 223 | - ], |
|
| 224 | - [ |
|
| 225 | - 'http://tata/', |
|
| 226 | - '//host/rep/page', |
|
| 227 | - 'http://tata/', |
|
| 228 | - ], |
|
| 229 | - [ |
|
| 230 | - '//tata/', |
|
| 231 | - 'http://host/rep/page', |
|
| 232 | - '//tata/', |
|
| 233 | - ], |
|
| 234 | - [ |
|
| 235 | - 'http://host/tata/', |
|
| 236 | - 'http://host/rep/page', |
|
| 237 | - '/tata/', |
|
| 238 | - ], |
|
| 239 | - [ |
|
| 240 | - '//host/tata/', |
|
| 241 | - '//host/rep/page', |
|
| 242 | - '/tata/', |
|
| 243 | - ], |
|
| 244 | - [ |
|
| 245 | - 'http://host/rep/page#tata', |
|
| 246 | - 'http://host/rep/page', |
|
| 247 | - '#tata', |
|
| 248 | - ], |
|
| 249 | - [ |
|
| 250 | - '//host/rep/page#tata', |
|
| 251 | - '//host/rep/page', |
|
| 252 | - '#tata', |
|
| 253 | - ], |
|
| 254 | - [ |
|
| 255 | - 'http://host/rep/page', |
|
| 256 | - 'http://host/rep/page', |
|
| 257 | - '', |
|
| 258 | - ], |
|
| 259 | - [ |
|
| 260 | - '//host/rep/page', |
|
| 261 | - '//host/rep/page', |
|
| 262 | - '', |
|
| 263 | - ], |
|
| 264 | - [ |
|
| 265 | - 'http://host/rep/tata', |
|
| 266 | - 'http://host/rep/page', |
|
| 267 | - 'tata', |
|
| 268 | - ], |
|
| 269 | - [ |
|
| 270 | - '//host/rep/tata', |
|
| 271 | - '//host/rep/page', |
|
| 272 | - 'tata', |
|
| 273 | - ], |
|
| 274 | - [ |
|
| 275 | - 'http://host/rep/?par=value', |
|
| 276 | - 'http://host/rep/page', |
|
| 277 | - '?par=value', |
|
| 278 | - ], |
|
| 279 | - [ |
|
| 280 | - '//host/rep/?par=value', |
|
| 281 | - '//host/rep/page', |
|
| 282 | - '?par=value', |
|
| 283 | - ], |
|
| 284 | - [ |
|
| 285 | - 'http://host/rep/tata?par=value', |
|
| 286 | - 'http://host/rep/page', |
|
| 287 | - 'tata?par=value', |
|
| 288 | - ], |
|
| 289 | - [ |
|
| 290 | - '//host/rep/tata?par=value', |
|
| 291 | - '//host/rep/page', |
|
| 292 | - 'tata?par=value', |
|
| 293 | - ], |
|
| 294 | - [ |
|
| 295 | - 'http://host/rep/tata#ancre', |
|
| 296 | - 'http://host/rep/page', |
|
| 297 | - 'tata#ancre', |
|
| 298 | - ], |
|
| 299 | - [ |
|
| 300 | - '//host/rep/tata#ancre', |
|
| 301 | - '//host/rep/page', |
|
| 302 | - 'tata#ancre', |
|
| 303 | - ], |
|
| 304 | - [ |
|
| 305 | - 'http://host/rep/tata?par=value#ancre', |
|
| 306 | - 'http://host/rep/page', |
|
| 307 | - 'tata?par=value#ancre', |
|
| 308 | - ], |
|
| 309 | - [ |
|
| 310 | - '//host/rep/tata?par=value#ancre', |
|
| 311 | - '//host/rep/page', |
|
| 312 | - 'tata?par=value#ancre', |
|
| 313 | - ], |
|
| 219 | + [ |
|
| 220 | + 'http://tata/', |
|
| 221 | + 'http://host/rep/page', |
|
| 222 | + 'http://tata/', |
|
| 223 | + ], |
|
| 224 | + [ |
|
| 225 | + 'http://tata/', |
|
| 226 | + '//host/rep/page', |
|
| 227 | + 'http://tata/', |
|
| 228 | + ], |
|
| 229 | + [ |
|
| 230 | + '//tata/', |
|
| 231 | + 'http://host/rep/page', |
|
| 232 | + '//tata/', |
|
| 233 | + ], |
|
| 234 | + [ |
|
| 235 | + 'http://host/tata/', |
|
| 236 | + 'http://host/rep/page', |
|
| 237 | + '/tata/', |
|
| 238 | + ], |
|
| 239 | + [ |
|
| 240 | + '//host/tata/', |
|
| 241 | + '//host/rep/page', |
|
| 242 | + '/tata/', |
|
| 243 | + ], |
|
| 244 | + [ |
|
| 245 | + 'http://host/rep/page#tata', |
|
| 246 | + 'http://host/rep/page', |
|
| 247 | + '#tata', |
|
| 248 | + ], |
|
| 249 | + [ |
|
| 250 | + '//host/rep/page#tata', |
|
| 251 | + '//host/rep/page', |
|
| 252 | + '#tata', |
|
| 253 | + ], |
|
| 254 | + [ |
|
| 255 | + 'http://host/rep/page', |
|
| 256 | + 'http://host/rep/page', |
|
| 257 | + '', |
|
| 258 | + ], |
|
| 259 | + [ |
|
| 260 | + '//host/rep/page', |
|
| 261 | + '//host/rep/page', |
|
| 262 | + '', |
|
| 263 | + ], |
|
| 264 | + [ |
|
| 265 | + 'http://host/rep/tata', |
|
| 266 | + 'http://host/rep/page', |
|
| 267 | + 'tata', |
|
| 268 | + ], |
|
| 269 | + [ |
|
| 270 | + '//host/rep/tata', |
|
| 271 | + '//host/rep/page', |
|
| 272 | + 'tata', |
|
| 273 | + ], |
|
| 274 | + [ |
|
| 275 | + 'http://host/rep/?par=value', |
|
| 276 | + 'http://host/rep/page', |
|
| 277 | + '?par=value', |
|
| 278 | + ], |
|
| 279 | + [ |
|
| 280 | + '//host/rep/?par=value', |
|
| 281 | + '//host/rep/page', |
|
| 282 | + '?par=value', |
|
| 283 | + ], |
|
| 284 | + [ |
|
| 285 | + 'http://host/rep/tata?par=value', |
|
| 286 | + 'http://host/rep/page', |
|
| 287 | + 'tata?par=value', |
|
| 288 | + ], |
|
| 289 | + [ |
|
| 290 | + '//host/rep/tata?par=value', |
|
| 291 | + '//host/rep/page', |
|
| 292 | + 'tata?par=value', |
|
| 293 | + ], |
|
| 294 | + [ |
|
| 295 | + 'http://host/rep/tata#ancre', |
|
| 296 | + 'http://host/rep/page', |
|
| 297 | + 'tata#ancre', |
|
| 298 | + ], |
|
| 299 | + [ |
|
| 300 | + '//host/rep/tata#ancre', |
|
| 301 | + '//host/rep/page', |
|
| 302 | + 'tata#ancre', |
|
| 303 | + ], |
|
| 304 | + [ |
|
| 305 | + 'http://host/rep/tata?par=value#ancre', |
|
| 306 | + 'http://host/rep/page', |
|
| 307 | + 'tata?par=value#ancre', |
|
| 308 | + ], |
|
| 309 | + [ |
|
| 310 | + '//host/rep/tata?par=value#ancre', |
|
| 311 | + '//host/rep/page', |
|
| 312 | + 'tata?par=value#ancre', |
|
| 313 | + ], |
|
| 314 | 314 | |
| 315 | - [ |
|
| 316 | - 'http://tata/', |
|
| 317 | - 'http://host/rep/page#anchor', |
|
| 318 | - 'http://tata/', |
|
| 319 | - ], |
|
| 320 | - [ |
|
| 321 | - 'http://host/tata/', |
|
| 322 | - 'http://host/rep/page#anchor', |
|
| 323 | - '/tata/', |
|
| 324 | - ], |
|
| 325 | - [ |
|
| 326 | - 'http://host/rep/page#tata', |
|
| 327 | - 'http://host/rep/page#anchor', |
|
| 328 | - '#tata', |
|
| 329 | - ], |
|
| 330 | - [ |
|
| 331 | - 'http://host/rep/page#anchor', |
|
| 332 | - 'http://host/rep/page#anchor', |
|
| 333 | - '', |
|
| 334 | - ], |
|
| 335 | - [ |
|
| 336 | - 'http://host/rep/tata', |
|
| 337 | - 'http://host/rep/page#anchor', |
|
| 338 | - 'tata', |
|
| 339 | - ], |
|
| 340 | - [ |
|
| 341 | - 'http://host/rep/?par=value', |
|
| 342 | - 'http://host/rep/page#anchor', |
|
| 343 | - '?par=value', |
|
| 344 | - ], |
|
| 345 | - [ |
|
| 346 | - 'http://host/rep/tata?par=value', |
|
| 347 | - 'http://host/rep/page#anchor', |
|
| 348 | - 'tata?par=value', |
|
| 349 | - ], |
|
| 350 | - [ |
|
| 351 | - 'http://host/rep/tata#ancre', |
|
| 352 | - 'http://host/rep/page#anchor', |
|
| 353 | - 'tata#ancre', |
|
| 354 | - ], |
|
| 355 | - [ |
|
| 356 | - 'http://host/rep/tata?par=value#ancre', |
|
| 357 | - 'http://host/rep/page#anchor', |
|
| 358 | - 'tata?par=value#ancre', |
|
| 359 | - ], |
|
| 315 | + [ |
|
| 316 | + 'http://tata/', |
|
| 317 | + 'http://host/rep/page#anchor', |
|
| 318 | + 'http://tata/', |
|
| 319 | + ], |
|
| 320 | + [ |
|
| 321 | + 'http://host/tata/', |
|
| 322 | + 'http://host/rep/page#anchor', |
|
| 323 | + '/tata/', |
|
| 324 | + ], |
|
| 325 | + [ |
|
| 326 | + 'http://host/rep/page#tata', |
|
| 327 | + 'http://host/rep/page#anchor', |
|
| 328 | + '#tata', |
|
| 329 | + ], |
|
| 330 | + [ |
|
| 331 | + 'http://host/rep/page#anchor', |
|
| 332 | + 'http://host/rep/page#anchor', |
|
| 333 | + '', |
|
| 334 | + ], |
|
| 335 | + [ |
|
| 336 | + 'http://host/rep/tata', |
|
| 337 | + 'http://host/rep/page#anchor', |
|
| 338 | + 'tata', |
|
| 339 | + ], |
|
| 340 | + [ |
|
| 341 | + 'http://host/rep/?par=value', |
|
| 342 | + 'http://host/rep/page#anchor', |
|
| 343 | + '?par=value', |
|
| 344 | + ], |
|
| 345 | + [ |
|
| 346 | + 'http://host/rep/tata?par=value', |
|
| 347 | + 'http://host/rep/page#anchor', |
|
| 348 | + 'tata?par=value', |
|
| 349 | + ], |
|
| 350 | + [ |
|
| 351 | + 'http://host/rep/tata#ancre', |
|
| 352 | + 'http://host/rep/page#anchor', |
|
| 353 | + 'tata#ancre', |
|
| 354 | + ], |
|
| 355 | + [ |
|
| 356 | + 'http://host/rep/tata?par=value#ancre', |
|
| 357 | + 'http://host/rep/page#anchor', |
|
| 358 | + 'tata?par=value#ancre', |
|
| 359 | + ], |
|
| 360 | 360 | |
| 361 | - [ |
|
| 362 | - 'http://tata/', |
|
| 363 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 364 | - 'http://tata/', |
|
| 365 | - ], |
|
| 366 | - [ |
|
| 367 | - 'http://host/tata/', |
|
| 368 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 369 | - '/tata/', |
|
| 370 | - ], |
|
| 371 | - [ |
|
| 372 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#tata', |
|
| 373 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 374 | - '#tata', |
|
| 375 | - ], |
|
| 376 | - [ |
|
| 377 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 378 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 379 | - '', |
|
| 380 | - ], |
|
| 381 | - [ |
|
| 382 | - 'http://host/rep/tata', |
|
| 383 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 384 | - 'tata', |
|
| 385 | - ], |
|
| 386 | - [ |
|
| 387 | - 'http://host/rep/?par=value', |
|
| 388 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 389 | - '?par=value', |
|
| 390 | - ], |
|
| 391 | - [ |
|
| 392 | - 'http://host/rep/tata?par=value', |
|
| 393 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 394 | - 'tata?par=value', |
|
| 395 | - ], |
|
| 396 | - [ |
|
| 397 | - 'http://host/rep/tata#ancre', |
|
| 398 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 399 | - 'tata#ancre', |
|
| 400 | - ], |
|
| 401 | - [ |
|
| 402 | - 'http://host/rep/tata?par=value#ancre', |
|
| 403 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 404 | - 'tata?par=value#ancre', |
|
| 405 | - ], |
|
| 361 | + [ |
|
| 362 | + 'http://tata/', |
|
| 363 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 364 | + 'http://tata/', |
|
| 365 | + ], |
|
| 366 | + [ |
|
| 367 | + 'http://host/tata/', |
|
| 368 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 369 | + '/tata/', |
|
| 370 | + ], |
|
| 371 | + [ |
|
| 372 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#tata', |
|
| 373 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 374 | + '#tata', |
|
| 375 | + ], |
|
| 376 | + [ |
|
| 377 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 378 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 379 | + '', |
|
| 380 | + ], |
|
| 381 | + [ |
|
| 382 | + 'http://host/rep/tata', |
|
| 383 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 384 | + 'tata', |
|
| 385 | + ], |
|
| 386 | + [ |
|
| 387 | + 'http://host/rep/?par=value', |
|
| 388 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 389 | + '?par=value', |
|
| 390 | + ], |
|
| 391 | + [ |
|
| 392 | + 'http://host/rep/tata?par=value', |
|
| 393 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 394 | + 'tata?par=value', |
|
| 395 | + ], |
|
| 396 | + [ |
|
| 397 | + 'http://host/rep/tata#ancre', |
|
| 398 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 399 | + 'tata#ancre', |
|
| 400 | + ], |
|
| 401 | + [ |
|
| 402 | + 'http://host/rep/tata?par=value#ancre', |
|
| 403 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc', |
|
| 404 | + 'tata?par=value#ancre', |
|
| 405 | + ], |
|
| 406 | 406 | |
| 407 | - [ |
|
| 408 | - 'http://tata/', |
|
| 409 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 410 | - 'http://tata/', |
|
| 411 | - ], |
|
| 412 | - [ |
|
| 413 | - 'http://host/tata/', |
|
| 414 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 415 | - '/tata/', |
|
| 416 | - ], |
|
| 417 | - [ |
|
| 418 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#tata', |
|
| 419 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 420 | - '#tata', |
|
| 421 | - ], |
|
| 422 | - [ |
|
| 423 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 424 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 425 | - '', |
|
| 426 | - ], |
|
| 427 | - [ |
|
| 428 | - 'http://host/rep/tata', |
|
| 429 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 430 | - 'tata', |
|
| 431 | - ], |
|
| 432 | - [ |
|
| 433 | - 'http://host/rep/?par=value', |
|
| 434 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 435 | - '?par=value', |
|
| 436 | - ], |
|
| 437 | - [ |
|
| 438 | - 'http://host/rep/tata?par=value', |
|
| 439 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 440 | - 'tata?par=value', |
|
| 441 | - ], |
|
| 442 | - [ |
|
| 443 | - 'http://host/rep/tata#ancre', |
|
| 444 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 445 | - 'tata#ancre', |
|
| 446 | - ], |
|
| 447 | - [ |
|
| 448 | - 'http://host/rep/tata?par=value#ancre', |
|
| 449 | - 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 450 | - 'tata?par=value#ancre', |
|
| 451 | - ], |
|
| 407 | + [ |
|
| 408 | + 'http://tata/', |
|
| 409 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 410 | + 'http://tata/', |
|
| 411 | + ], |
|
| 412 | + [ |
|
| 413 | + 'http://host/tata/', |
|
| 414 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 415 | + '/tata/', |
|
| 416 | + ], |
|
| 417 | + [ |
|
| 418 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#tata', |
|
| 419 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 420 | + '#tata', |
|
| 421 | + ], |
|
| 422 | + [ |
|
| 423 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 424 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 425 | + '', |
|
| 426 | + ], |
|
| 427 | + [ |
|
| 428 | + 'http://host/rep/tata', |
|
| 429 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 430 | + 'tata', |
|
| 431 | + ], |
|
| 432 | + [ |
|
| 433 | + 'http://host/rep/?par=value', |
|
| 434 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 435 | + '?par=value', |
|
| 436 | + ], |
|
| 437 | + [ |
|
| 438 | + 'http://host/rep/tata?par=value', |
|
| 439 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 440 | + 'tata?par=value', |
|
| 441 | + ], |
|
| 442 | + [ |
|
| 443 | + 'http://host/rep/tata#ancre', |
|
| 444 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 445 | + 'tata#ancre', |
|
| 446 | + ], |
|
| 447 | + [ |
|
| 448 | + 'http://host/rep/tata?par=value#ancre', |
|
| 449 | + 'http://host/rep/page?titi=valeur&bidule=chose/truc#anchor', |
|
| 450 | + 'tata?par=value#ancre', |
|
| 451 | + ], |
|
| 452 | 452 | |
| 453 | - [ |
|
| 454 | - 'http://toto/?hoc', |
|
| 455 | - 'http://toto/ad?hic', |
|
| 456 | - '?hoc', |
|
| 457 | - ], |
|
| 458 | - [ |
|
| 459 | - 'http://toto/#hup', |
|
| 460 | - 'http://toto/./', |
|
| 461 | - '#hup', |
|
| 462 | - ], |
|
| 463 | - [ |
|
| 464 | - 'http://toto/bois/', |
|
| 465 | - 'http://toto/fleche/de/tout', |
|
| 466 | - '/bois/', |
|
| 467 | - ], |
|
| 468 | - [ |
|
| 469 | - 'http://toto/du/yop', |
|
| 470 | - 'http://toto/du/lac#1', |
|
| 471 | - 'yop', |
|
| 472 | - ], |
|
| 473 | - [ |
|
| 474 | - 'http://tata/', |
|
| 475 | - 'http://toto/', |
|
| 476 | - 'http://tata/', |
|
| 477 | - ], |
|
| 478 | - [ |
|
| 479 | - 'http://toto/allo#3', |
|
| 480 | - 'http://toto/allo', |
|
| 481 | - '#3', |
|
| 482 | - ], |
|
| 483 | - [ |
|
| 484 | - 'http://tata/', |
|
| 485 | - 'http://toto/', |
|
| 486 | - 'http://tata/./', |
|
| 487 | - ], |
|
| 488 | - [ |
|
| 489 | - 'http://toto/et#lui', |
|
| 490 | - 'http://toto/et#lui', |
|
| 491 | - '', |
|
| 492 | - ], |
|
| 493 | - [ |
|
| 494 | - 'http://toto/', |
|
| 495 | - 'http://toto', |
|
| 496 | - './', |
|
| 497 | - ], |
|
| 498 | - [ |
|
| 499 | - 'http://toto/hop/', |
|
| 500 | - 'http://toto/hop/a', |
|
| 501 | - './', |
|
| 502 | - ], |
|
| 503 | - ]; |
|
| 504 | - } |
|
| 453 | + [ |
|
| 454 | + 'http://toto/?hoc', |
|
| 455 | + 'http://toto/ad?hic', |
|
| 456 | + '?hoc', |
|
| 457 | + ], |
|
| 458 | + [ |
|
| 459 | + 'http://toto/#hup', |
|
| 460 | + 'http://toto/./', |
|
| 461 | + '#hup', |
|
| 462 | + ], |
|
| 463 | + [ |
|
| 464 | + 'http://toto/bois/', |
|
| 465 | + 'http://toto/fleche/de/tout', |
|
| 466 | + '/bois/', |
|
| 467 | + ], |
|
| 468 | + [ |
|
| 469 | + 'http://toto/du/yop', |
|
| 470 | + 'http://toto/du/lac#1', |
|
| 471 | + 'yop', |
|
| 472 | + ], |
|
| 473 | + [ |
|
| 474 | + 'http://tata/', |
|
| 475 | + 'http://toto/', |
|
| 476 | + 'http://tata/', |
|
| 477 | + ], |
|
| 478 | + [ |
|
| 479 | + 'http://toto/allo#3', |
|
| 480 | + 'http://toto/allo', |
|
| 481 | + '#3', |
|
| 482 | + ], |
|
| 483 | + [ |
|
| 484 | + 'http://tata/', |
|
| 485 | + 'http://toto/', |
|
| 486 | + 'http://tata/./', |
|
| 487 | + ], |
|
| 488 | + [ |
|
| 489 | + 'http://toto/et#lui', |
|
| 490 | + 'http://toto/et#lui', |
|
| 491 | + '', |
|
| 492 | + ], |
|
| 493 | + [ |
|
| 494 | + 'http://toto/', |
|
| 495 | + 'http://toto', |
|
| 496 | + './', |
|
| 497 | + ], |
|
| 498 | + [ |
|
| 499 | + 'http://toto/hop/', |
|
| 500 | + 'http://toto/hop/a', |
|
| 501 | + './', |
|
| 502 | + ], |
|
| 503 | + ]; |
|
| 504 | + } |
|
| 505 | 505 | } |
@@ -13,46 +13,46 @@ |
||
| 13 | 13 | |
| 14 | 14 | class TesterUrlAbsolueTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('./inc/utils.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('./inc/utils.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - #[DataProvider('providerUtilsTesterUrlAbsolue')] |
|
| 21 | - public function testUtilsTesterUrlAbsolue($expected, ...$args): void { |
|
| 22 | - $actual = tester_url_absolue(...$args); |
|
| 23 | - $this->assertSame($expected, $actual); |
|
| 24 | - } |
|
| 20 | + #[DataProvider('providerUtilsTesterUrlAbsolue')] |
|
| 21 | + public function testUtilsTesterUrlAbsolue($expected, ...$args): void { |
|
| 22 | + $actual = tester_url_absolue(...$args); |
|
| 23 | + $this->assertSame($expected, $actual); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public static function providerUtilsTesterUrlAbsolue(): array { |
|
| 27 | - return [ |
|
| 28 | - 0 => [ |
|
| 29 | - 0 => true, |
|
| 30 | - 1 => 'http://www.spip.net/', |
|
| 31 | - ], |
|
| 32 | - 1 => [ |
|
| 33 | - 0 => true, |
|
| 34 | - 1 => 'https://www.spip.net/', |
|
| 35 | - ], |
|
| 36 | - 2 => [ |
|
| 37 | - 0 => true, |
|
| 38 | - 1 => 'http://www.spip.net/sousrep/fr/', |
|
| 39 | - ], |
|
| 40 | - 3 => [ |
|
| 41 | - 0 => true, |
|
| 42 | - 1 => 'ftp://www.spip.net/', |
|
| 43 | - ], |
|
| 44 | - 4 => [ |
|
| 45 | - 0 => true, |
|
| 46 | - 1 => '//www.spip.net/', |
|
| 47 | - ], |
|
| 48 | - 5 => [ |
|
| 49 | - 0 => false, |
|
| 50 | - 1 => '/spip/?page=sommaire', |
|
| 51 | - ], |
|
| 52 | - 6 => [ |
|
| 53 | - 0 => false, |
|
| 54 | - 1 => 'spip/?page=sommaire', |
|
| 55 | - ], |
|
| 56 | - ]; |
|
| 57 | - } |
|
| 26 | + public static function providerUtilsTesterUrlAbsolue(): array { |
|
| 27 | + return [ |
|
| 28 | + 0 => [ |
|
| 29 | + 0 => true, |
|
| 30 | + 1 => 'http://www.spip.net/', |
|
| 31 | + ], |
|
| 32 | + 1 => [ |
|
| 33 | + 0 => true, |
|
| 34 | + 1 => 'https://www.spip.net/', |
|
| 35 | + ], |
|
| 36 | + 2 => [ |
|
| 37 | + 0 => true, |
|
| 38 | + 1 => 'http://www.spip.net/sousrep/fr/', |
|
| 39 | + ], |
|
| 40 | + 3 => [ |
|
| 41 | + 0 => true, |
|
| 42 | + 1 => 'ftp://www.spip.net/', |
|
| 43 | + ], |
|
| 44 | + 4 => [ |
|
| 45 | + 0 => true, |
|
| 46 | + 1 => '//www.spip.net/', |
|
| 47 | + ], |
|
| 48 | + 5 => [ |
|
| 49 | + 0 => false, |
|
| 50 | + 1 => '/spip/?page=sommaire', |
|
| 51 | + ], |
|
| 52 | + 6 => [ |
|
| 53 | + 0 => false, |
|
| 54 | + 1 => 'spip/?page=sommaire', |
|
| 55 | + ], |
|
| 56 | + ]; |
|
| 57 | + } |
|
| 58 | 58 | } |
@@ -13,21 +13,21 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class LiensAbsolusPriveTest extends LiensAbsolusTest |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - #chdir(dirname(__DIR__, 2)); |
|
| 18 | - find_in_path('./inc/utils.php', '', true); |
|
| 19 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + #chdir(dirname(__DIR__, 2)); |
|
| 18 | + find_in_path('./inc/utils.php', '', true); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function testVerifierEspace(): void { |
|
| 22 | - if (!test_espace_prive()) { |
|
| 23 | - $this->markTestIncomplete('FIXME: être considéré dans l’espace privé dans le test'); |
|
| 24 | - } |
|
| 25 | - $this->assertTrue(test_espace_prive(), 'On doit être dans l’espace privé'); |
|
| 21 | + public function testVerifierEspace(): void { |
|
| 22 | + if (!test_espace_prive()) { |
|
| 23 | + $this->markTestIncomplete('FIXME: être considéré dans l’espace privé dans le test'); |
|
| 24 | + } |
|
| 25 | + $this->assertTrue(test_espace_prive(), 'On doit être dans l’espace privé'); |
|
| 26 | 26 | |
| 27 | - } |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - public static function tearDownAfterClass(): void { |
|
| 31 | - #chdir(_SPIP_TEST_CHDIR); |
|
| 32 | - } |
|
| 30 | + public static function tearDownAfterClass(): void { |
|
| 31 | + #chdir(_SPIP_TEST_CHDIR); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -10,47 +10,47 @@ |
||
| 10 | 10 | |
| 11 | 11 | class LiensAbsolusTest extends TestCase |
| 12 | 12 | { |
| 13 | - public static function setUpBeforeClass(): void { |
|
| 14 | - find_in_path('./inc/utils.php', '', true); |
|
| 15 | - } |
|
| 16 | - |
|
| 17 | - public function testVerifierEspace() { |
|
| 18 | - $this->assertFalse(test_espace_prive(), 'On doit être dans l’espace public'); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - #[Depends('testVerifierEspace')] |
|
| 22 | - public function testLienPrive() { |
|
| 23 | - $relatif = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, true); |
|
| 24 | - $absolu = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, false); |
|
| 25 | - $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien prive</a>'; |
|
| 26 | - $case = 'bla bla <a href=\'' . $relatif . '\'>lien prive</a>'; |
|
| 27 | - $actual = liens_absolus($case); |
|
| 28 | - $this->assertEquals($expected, $actual); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - #[Depends('testVerifierEspace')] |
|
| 32 | - public function testLienPublic() { |
|
| 33 | - $relatif = generer_url_public('toto', 'truc=machin&chose=bidule', false, true); |
|
| 34 | - $absolu = generer_url_public('toto', 'truc=machin&chose=bidule', false, false); |
|
| 35 | - $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien public</a>'; |
|
| 36 | - $case = 'bla bla <a href=\'' . $relatif . '\'>lien public</a>'; |
|
| 37 | - $actual = liens_absolus($case); |
|
| 38 | - $this->assertEquals($expected, $actual); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - #[Depends('testVerifierEspace')] |
|
| 42 | - public function testLienMailto() { |
|
| 43 | - $expected = 'bla bla <a href="mailto:toto">email</a>'; |
|
| 44 | - $case = 'bla bla <a href="mailto:toto">email</a>'; |
|
| 45 | - $actual = liens_absolus($case); |
|
| 46 | - $this->assertEquals($expected, $actual); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - #[Depends('testVerifierEspace')] |
|
| 50 | - public function testLienJavascript() { |
|
| 51 | - $expected = 'bla bla <a href="javascript:open()">javascript</a>'; |
|
| 52 | - $case = 'bla bla <a href="javascript:open()">javascript</a>'; |
|
| 53 | - $actual = liens_absolus($case); |
|
| 54 | - $this->assertEquals($expected, $actual); |
|
| 55 | - } |
|
| 13 | + public static function setUpBeforeClass(): void { |
|
| 14 | + find_in_path('./inc/utils.php', '', true); |
|
| 15 | + } |
|
| 16 | + |
|
| 17 | + public function testVerifierEspace() { |
|
| 18 | + $this->assertFalse(test_espace_prive(), 'On doit être dans l’espace public'); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + #[Depends('testVerifierEspace')] |
|
| 22 | + public function testLienPrive() { |
|
| 23 | + $relatif = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, true); |
|
| 24 | + $absolu = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, false); |
|
| 25 | + $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien prive</a>'; |
|
| 26 | + $case = 'bla bla <a href=\'' . $relatif . '\'>lien prive</a>'; |
|
| 27 | + $actual = liens_absolus($case); |
|
| 28 | + $this->assertEquals($expected, $actual); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + #[Depends('testVerifierEspace')] |
|
| 32 | + public function testLienPublic() { |
|
| 33 | + $relatif = generer_url_public('toto', 'truc=machin&chose=bidule', false, true); |
|
| 34 | + $absolu = generer_url_public('toto', 'truc=machin&chose=bidule', false, false); |
|
| 35 | + $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien public</a>'; |
|
| 36 | + $case = 'bla bla <a href=\'' . $relatif . '\'>lien public</a>'; |
|
| 37 | + $actual = liens_absolus($case); |
|
| 38 | + $this->assertEquals($expected, $actual); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + #[Depends('testVerifierEspace')] |
|
| 42 | + public function testLienMailto() { |
|
| 43 | + $expected = 'bla bla <a href="mailto:toto">email</a>'; |
|
| 44 | + $case = 'bla bla <a href="mailto:toto">email</a>'; |
|
| 45 | + $actual = liens_absolus($case); |
|
| 46 | + $this->assertEquals($expected, $actual); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + #[Depends('testVerifierEspace')] |
|
| 50 | + public function testLienJavascript() { |
|
| 51 | + $expected = 'bla bla <a href="javascript:open()">javascript</a>'; |
|
| 52 | + $case = 'bla bla <a href="javascript:open()">javascript</a>'; |
|
| 53 | + $actual = liens_absolus($case); |
|
| 54 | + $this->assertEquals($expected, $actual); |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | public function testLienPrive() { |
| 23 | 23 | $relatif = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, true); |
| 24 | 24 | $absolu = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, false); |
| 25 | - $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien prive</a>'; |
|
| 26 | - $case = 'bla bla <a href=\'' . $relatif . '\'>lien prive</a>'; |
|
| 25 | + $expected = 'bla bla <a href=\''.str_replace('&', '&', $absolu).'\'>lien prive</a>'; |
|
| 26 | + $case = 'bla bla <a href=\''.$relatif.'\'>lien prive</a>'; |
|
| 27 | 27 | $actual = liens_absolus($case); |
| 28 | 28 | $this->assertEquals($expected, $actual); |
| 29 | 29 | } |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | public function testLienPublic() { |
| 33 | 33 | $relatif = generer_url_public('toto', 'truc=machin&chose=bidule', false, true); |
| 34 | 34 | $absolu = generer_url_public('toto', 'truc=machin&chose=bidule', false, false); |
| 35 | - $expected = 'bla bla <a href=\'' . str_replace('&', '&', $absolu) . '\'>lien public</a>'; |
|
| 36 | - $case = 'bla bla <a href=\'' . $relatif . '\'>lien public</a>'; |
|
| 35 | + $expected = 'bla bla <a href=\''.str_replace('&', '&', $absolu).'\'>lien public</a>'; |
|
| 36 | + $case = 'bla bla <a href=\''.$relatif.'\'>lien public</a>'; |
|
| 37 | 37 | $actual = liens_absolus($case); |
| 38 | 38 | $this->assertEquals($expected, $actual); |
| 39 | 39 | } |
@@ -13,244 +13,244 @@ |
||
| 13 | 13 | |
| 14 | 14 | class ParametreUrlTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('./inc/utils.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('./inc/utils.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - #[DataProvider('providerUtilsParametreUrl')] |
|
| 21 | - public function testUtilsParametreUrl($expected, ...$args): void { |
|
| 22 | - $actual = parametre_url(...$args); |
|
| 23 | - $this->assertSame($expected, $actual); |
|
| 24 | - } |
|
| 20 | + #[DataProvider('providerUtilsParametreUrl')] |
|
| 21 | + public function testUtilsParametreUrl($expected, ...$args): void { |
|
| 22 | + $actual = parametre_url(...$args); |
|
| 23 | + $this->assertSame($expected, $actual); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public static function providerUtilsParametreUrl(): array { |
|
| 27 | - return [ |
|
| 28 | - 0 => [ |
|
| 29 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&ajout=valajout', |
|
| 30 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 31 | - 2 => 'ajout', |
|
| 32 | - 3 => 'valajout', |
|
| 33 | - ], |
|
| 34 | - 1 => [ |
|
| 35 | - 0 => '/ecrire/?exec=exec&no_val', |
|
| 36 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 37 | - 2 => 'id_obj', |
|
| 38 | - 3 => '', |
|
| 39 | - ], |
|
| 40 | - 2 => [ |
|
| 41 | - 0 => '/ecrire/?exec=exec&id_obj=changobj&no_val', |
|
| 42 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 43 | - 2 => 'id_obj', |
|
| 44 | - 3 => 'changobj', |
|
| 45 | - ], |
|
| 46 | - 3 => [ |
|
| 47 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val=yes_val', |
|
| 48 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 49 | - 2 => 'no_val', |
|
| 50 | - 3 => 'yes_val', |
|
| 51 | - ], |
|
| 52 | - 4 => [ |
|
| 53 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj', |
|
| 54 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 55 | - 2 => 'no_val', |
|
| 56 | - 3 => '', |
|
| 57 | - ], |
|
| 58 | - 5 => [ |
|
| 59 | - 0 => '/ecrire/?exec=exec&no_val', |
|
| 60 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 61 | - 2 => 'id_obj', |
|
| 62 | - 3 => '', |
|
| 63 | - 4 => '&', |
|
| 64 | - ], |
|
| 65 | - 6 => [ |
|
| 66 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj', |
|
| 67 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 68 | - 2 => 'no_val', |
|
| 69 | - 3 => '', |
|
| 70 | - 4 => '&', |
|
| 71 | - ], |
|
| 72 | - 7 => [ |
|
| 73 | - 0 => 'id_objv', |
|
| 74 | - 1 => '/ecrire/?exec=exec&id_obj=id_objv&no_val', |
|
| 75 | - 2 => 'id_obj', |
|
| 76 | - ], |
|
| 77 | - 8 => [ |
|
| 78 | - 0 => '', |
|
| 79 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 80 | - 2 => 'no_val', |
|
| 81 | - ], |
|
| 82 | - 9 => [ |
|
| 83 | - 0 => null, |
|
| 84 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 85 | - 2 => 'toto', |
|
| 86 | - ], |
|
| 87 | - 10 => [ |
|
| 88 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&id1=valeur&id2=valeur&id3=valeur', |
|
| 89 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 90 | - 2 => 'id1|id2|id3', |
|
| 91 | - 3 => 'valeur', |
|
| 92 | - ], |
|
| 93 | - 11 => [ |
|
| 94 | - 0 => '/ecrire/?exec=exec&id_obj=valeur&no_val&id2=valeur&id3=valeur', |
|
| 95 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 96 | - 2 => 'id_obj|id2|id3', |
|
| 97 | - 3 => 'valeur', |
|
| 98 | - ], |
|
| 99 | - 12 => [ |
|
| 100 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val=valeur&id1=valeur&id3=valeur', |
|
| 101 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 102 | - 2 => 'id1|no_val|id3', |
|
| 103 | - 3 => 'valeur', |
|
| 104 | - ], |
|
| 105 | - 13 => [ |
|
| 106 | - 0 => null, |
|
| 107 | - 1 => '/ecrire/?exec=exec&id_obj=id_objv&no_val', |
|
| 108 | - 2 => 'id_obj|no_val', |
|
| 109 | - ], |
|
| 110 | - 14 => [ |
|
| 111 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 112 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 113 | - 2 => 'tab', |
|
| 114 | - 3 => [], |
|
| 115 | - ], |
|
| 116 | - 15 => [ |
|
| 117 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=0&tab[]=-1&tab[]=1&tab[]=2&tab[]=3&tab[]=4&tab[]=5&tab[]=6&tab[]=7&tab[]=10&tab[]=20&tab[]=30&tab[]=50&tab[]=100&tab[]=1000&tab[]=10000', |
|
| 118 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 119 | - 2 => 'tab', |
|
| 120 | - 3 => [ |
|
| 121 | - 0 => 0, |
|
| 122 | - 1 => -1, |
|
| 123 | - 2 => 1, |
|
| 124 | - 3 => 2, |
|
| 125 | - 4 => 3, |
|
| 126 | - 5 => 4, |
|
| 127 | - 6 => 5, |
|
| 128 | - 7 => 6, |
|
| 129 | - 8 => 7, |
|
| 130 | - 9 => 10, |
|
| 131 | - 10 => 20, |
|
| 132 | - 11 => 30, |
|
| 133 | - 12 => 50, |
|
| 134 | - 13 => 100, |
|
| 135 | - 14 => 1000, |
|
| 136 | - 15 => 10000, |
|
| 137 | - ], |
|
| 138 | - ], |
|
| 139 | - 16 => [ |
|
| 140 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=1&tab[]=', |
|
| 141 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 142 | - 2 => 'tab', |
|
| 143 | - 3 => [ |
|
| 144 | - 0 => true, |
|
| 145 | - 1 => false, |
|
| 146 | - ], |
|
| 147 | - ], |
|
| 148 | - 17 => [ |
|
| 149 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=Array&tab[]=Array&tab[]=Array&tab[]=Array', |
|
| 150 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 151 | - 2 => 'tab', |
|
| 152 | - 3 => [ |
|
| 153 | - 0 => [], |
|
| 154 | - 1 => [ |
|
| 155 | - 0 => '', |
|
| 156 | - 1 => '0', |
|
| 157 | - 2 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 158 | - 3 => 'Un texte avec des entités &<>"', |
|
| 159 | - 4 => 'Un texte avec des entit&eacute;s echap&eacute; &amp;&lt;&gt;&quot;', |
|
| 160 | - 5 => 'Un texte avec des entités numériques &<>"', |
|
| 161 | - 6 => 'Un texte avec des entit&#233;s num&#233;riques echap&#233;es &#38;&#60;&#62;&quot;', |
|
| 162 | - 7 => 'Un texte sans entites &<>"\'', |
|
| 163 | - 8 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 164 | - 9 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 165 | - 10 => 'Un texte avec des retour |
|
| 26 | + public static function providerUtilsParametreUrl(): array { |
|
| 27 | + return [ |
|
| 28 | + 0 => [ |
|
| 29 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&ajout=valajout', |
|
| 30 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 31 | + 2 => 'ajout', |
|
| 32 | + 3 => 'valajout', |
|
| 33 | + ], |
|
| 34 | + 1 => [ |
|
| 35 | + 0 => '/ecrire/?exec=exec&no_val', |
|
| 36 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 37 | + 2 => 'id_obj', |
|
| 38 | + 3 => '', |
|
| 39 | + ], |
|
| 40 | + 2 => [ |
|
| 41 | + 0 => '/ecrire/?exec=exec&id_obj=changobj&no_val', |
|
| 42 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 43 | + 2 => 'id_obj', |
|
| 44 | + 3 => 'changobj', |
|
| 45 | + ], |
|
| 46 | + 3 => [ |
|
| 47 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val=yes_val', |
|
| 48 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 49 | + 2 => 'no_val', |
|
| 50 | + 3 => 'yes_val', |
|
| 51 | + ], |
|
| 52 | + 4 => [ |
|
| 53 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj', |
|
| 54 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 55 | + 2 => 'no_val', |
|
| 56 | + 3 => '', |
|
| 57 | + ], |
|
| 58 | + 5 => [ |
|
| 59 | + 0 => '/ecrire/?exec=exec&no_val', |
|
| 60 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 61 | + 2 => 'id_obj', |
|
| 62 | + 3 => '', |
|
| 63 | + 4 => '&', |
|
| 64 | + ], |
|
| 65 | + 6 => [ |
|
| 66 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj', |
|
| 67 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 68 | + 2 => 'no_val', |
|
| 69 | + 3 => '', |
|
| 70 | + 4 => '&', |
|
| 71 | + ], |
|
| 72 | + 7 => [ |
|
| 73 | + 0 => 'id_objv', |
|
| 74 | + 1 => '/ecrire/?exec=exec&id_obj=id_objv&no_val', |
|
| 75 | + 2 => 'id_obj', |
|
| 76 | + ], |
|
| 77 | + 8 => [ |
|
| 78 | + 0 => '', |
|
| 79 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 80 | + 2 => 'no_val', |
|
| 81 | + ], |
|
| 82 | + 9 => [ |
|
| 83 | + 0 => null, |
|
| 84 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 85 | + 2 => 'toto', |
|
| 86 | + ], |
|
| 87 | + 10 => [ |
|
| 88 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&id1=valeur&id2=valeur&id3=valeur', |
|
| 89 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 90 | + 2 => 'id1|id2|id3', |
|
| 91 | + 3 => 'valeur', |
|
| 92 | + ], |
|
| 93 | + 11 => [ |
|
| 94 | + 0 => '/ecrire/?exec=exec&id_obj=valeur&no_val&id2=valeur&id3=valeur', |
|
| 95 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 96 | + 2 => 'id_obj|id2|id3', |
|
| 97 | + 3 => 'valeur', |
|
| 98 | + ], |
|
| 99 | + 12 => [ |
|
| 100 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val=valeur&id1=valeur&id3=valeur', |
|
| 101 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 102 | + 2 => 'id1|no_val|id3', |
|
| 103 | + 3 => 'valeur', |
|
| 104 | + ], |
|
| 105 | + 13 => [ |
|
| 106 | + 0 => null, |
|
| 107 | + 1 => '/ecrire/?exec=exec&id_obj=id_objv&no_val', |
|
| 108 | + 2 => 'id_obj|no_val', |
|
| 109 | + ], |
|
| 110 | + 14 => [ |
|
| 111 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 112 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 113 | + 2 => 'tab', |
|
| 114 | + 3 => [], |
|
| 115 | + ], |
|
| 116 | + 15 => [ |
|
| 117 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=0&tab[]=-1&tab[]=1&tab[]=2&tab[]=3&tab[]=4&tab[]=5&tab[]=6&tab[]=7&tab[]=10&tab[]=20&tab[]=30&tab[]=50&tab[]=100&tab[]=1000&tab[]=10000', |
|
| 118 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 119 | + 2 => 'tab', |
|
| 120 | + 3 => [ |
|
| 121 | + 0 => 0, |
|
| 122 | + 1 => -1, |
|
| 123 | + 2 => 1, |
|
| 124 | + 3 => 2, |
|
| 125 | + 4 => 3, |
|
| 126 | + 5 => 4, |
|
| 127 | + 6 => 5, |
|
| 128 | + 7 => 6, |
|
| 129 | + 8 => 7, |
|
| 130 | + 9 => 10, |
|
| 131 | + 10 => 20, |
|
| 132 | + 11 => 30, |
|
| 133 | + 12 => 50, |
|
| 134 | + 13 => 100, |
|
| 135 | + 14 => 1000, |
|
| 136 | + 15 => 10000, |
|
| 137 | + ], |
|
| 138 | + ], |
|
| 139 | + 16 => [ |
|
| 140 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=1&tab[]=', |
|
| 141 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 142 | + 2 => 'tab', |
|
| 143 | + 3 => [ |
|
| 144 | + 0 => true, |
|
| 145 | + 1 => false, |
|
| 146 | + ], |
|
| 147 | + ], |
|
| 148 | + 17 => [ |
|
| 149 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=Array&tab[]=Array&tab[]=Array&tab[]=Array', |
|
| 150 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 151 | + 2 => 'tab', |
|
| 152 | + 3 => [ |
|
| 153 | + 0 => [], |
|
| 154 | + 1 => [ |
|
| 155 | + 0 => '', |
|
| 156 | + 1 => '0', |
|
| 157 | + 2 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', |
|
| 158 | + 3 => 'Un texte avec des entités &<>"', |
|
| 159 | + 4 => 'Un texte avec des entit&eacute;s echap&eacute; &amp;&lt;&gt;&quot;', |
|
| 160 | + 5 => 'Un texte avec des entités numériques &<>"', |
|
| 161 | + 6 => 'Un texte avec des entit&#233;s num&#233;riques echap&#233;es &#38;&#60;&#62;&quot;', |
|
| 162 | + 7 => 'Un texte sans entites &<>"\'', |
|
| 163 | + 8 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', |
|
| 164 | + 9 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', |
|
| 165 | + 10 => 'Un texte avec des retour |
|
| 166 | 166 | a la ligne et meme des |
| 167 | 167 | |
| 168 | 168 | paragraphes', |
| 169 | - ], |
|
| 170 | - 2 => [ |
|
| 171 | - 0 => 0, |
|
| 172 | - 1 => -1, |
|
| 173 | - 2 => 1, |
|
| 174 | - 3 => 2, |
|
| 175 | - 4 => 3, |
|
| 176 | - 5 => 4, |
|
| 177 | - 6 => 5, |
|
| 178 | - 7 => 6, |
|
| 179 | - 8 => 7, |
|
| 180 | - 9 => 10, |
|
| 181 | - 10 => 20, |
|
| 182 | - 11 => 30, |
|
| 183 | - 12 => 50, |
|
| 184 | - 13 => 100, |
|
| 185 | - 14 => 1000, |
|
| 186 | - 15 => 10000, |
|
| 187 | - ], |
|
| 188 | - 3 => [ |
|
| 189 | - 0 => true, |
|
| 190 | - 1 => false, |
|
| 191 | - ], |
|
| 192 | - ], |
|
| 193 | - ], |
|
| 194 | - 18 => [ |
|
| 195 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 196 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 197 | - 2 => 'tab[]', |
|
| 198 | - 3 => [], |
|
| 199 | - ], |
|
| 200 | - 19 => [ |
|
| 201 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=0&tab[]=-1&tab[]=1&tab[]=2&tab[]=3&tab[]=4&tab[]=5&tab[]=6&tab[]=7&tab[]=10&tab[]=20&tab[]=30&tab[]=50&tab[]=100&tab[]=1000&tab[]=10000', |
|
| 202 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 203 | - 2 => 'tab[]', |
|
| 204 | - 3 => [ |
|
| 205 | - 0 => 0, |
|
| 206 | - 1 => -1, |
|
| 207 | - 2 => 1, |
|
| 208 | - 3 => 2, |
|
| 209 | - 4 => 3, |
|
| 210 | - 5 => 4, |
|
| 211 | - 6 => 5, |
|
| 212 | - 7 => 6, |
|
| 213 | - 8 => 7, |
|
| 214 | - 9 => 10, |
|
| 215 | - 10 => 20, |
|
| 216 | - 11 => 30, |
|
| 217 | - 12 => 50, |
|
| 218 | - 13 => 100, |
|
| 219 | - 14 => 1000, |
|
| 220 | - 15 => 10000, |
|
| 221 | - ], |
|
| 222 | - ], |
|
| 223 | - 20 => [ |
|
| 224 | - 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=1&tab[]=', |
|
| 225 | - 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 226 | - 2 => 'tab[]', |
|
| 227 | - 3 => [ |
|
| 228 | - 0 => true, |
|
| 229 | - 1 => false, |
|
| 230 | - ], |
|
| 231 | - ], |
|
| 232 | - 21 => [ |
|
| 233 | - 0 => 'http://domaine/spip.php?t[]=0&t[]=2', |
|
| 234 | - 1 => 'http://domaine/spip.php?t[]=1', |
|
| 235 | - 2 => 't', |
|
| 236 | - 3 => [0, 2], |
|
| 237 | - ], |
|
| 238 | - 22 => [ |
|
| 239 | - 0 => 'http://domaine/spip.php?t[]=0&t[]=2', |
|
| 240 | - 1 => 'http://domaine/spip.php?t[]=1', |
|
| 241 | - 2 => 't[]', |
|
| 242 | - 3 => [0, 2], |
|
| 243 | - ], |
|
| 244 | - 23 => [ |
|
| 245 | - 0 => ['1', '2'], |
|
| 246 | - 1 => 'http://domaine/spip.php?t[]=1&t[]=2', |
|
| 247 | - 2 => 't', |
|
| 248 | - ], |
|
| 249 | - 24 => [ |
|
| 250 | - 0 => ['1', '2'], |
|
| 251 | - 1 => 'http://domaine/spip.php?t[]=1&t[]=2', |
|
| 252 | - 2 => 't[]', |
|
| 253 | - ], |
|
| 254 | - ]; |
|
| 255 | - } |
|
| 169 | + ], |
|
| 170 | + 2 => [ |
|
| 171 | + 0 => 0, |
|
| 172 | + 1 => -1, |
|
| 173 | + 2 => 1, |
|
| 174 | + 3 => 2, |
|
| 175 | + 4 => 3, |
|
| 176 | + 5 => 4, |
|
| 177 | + 6 => 5, |
|
| 178 | + 7 => 6, |
|
| 179 | + 8 => 7, |
|
| 180 | + 9 => 10, |
|
| 181 | + 10 => 20, |
|
| 182 | + 11 => 30, |
|
| 183 | + 12 => 50, |
|
| 184 | + 13 => 100, |
|
| 185 | + 14 => 1000, |
|
| 186 | + 15 => 10000, |
|
| 187 | + ], |
|
| 188 | + 3 => [ |
|
| 189 | + 0 => true, |
|
| 190 | + 1 => false, |
|
| 191 | + ], |
|
| 192 | + ], |
|
| 193 | + ], |
|
| 194 | + 18 => [ |
|
| 195 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 196 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 197 | + 2 => 'tab[]', |
|
| 198 | + 3 => [], |
|
| 199 | + ], |
|
| 200 | + 19 => [ |
|
| 201 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=0&tab[]=-1&tab[]=1&tab[]=2&tab[]=3&tab[]=4&tab[]=5&tab[]=6&tab[]=7&tab[]=10&tab[]=20&tab[]=30&tab[]=50&tab[]=100&tab[]=1000&tab[]=10000', |
|
| 202 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 203 | + 2 => 'tab[]', |
|
| 204 | + 3 => [ |
|
| 205 | + 0 => 0, |
|
| 206 | + 1 => -1, |
|
| 207 | + 2 => 1, |
|
| 208 | + 3 => 2, |
|
| 209 | + 4 => 3, |
|
| 210 | + 5 => 4, |
|
| 211 | + 6 => 5, |
|
| 212 | + 7 => 6, |
|
| 213 | + 8 => 7, |
|
| 214 | + 9 => 10, |
|
| 215 | + 10 => 20, |
|
| 216 | + 11 => 30, |
|
| 217 | + 12 => 50, |
|
| 218 | + 13 => 100, |
|
| 219 | + 14 => 1000, |
|
| 220 | + 15 => 10000, |
|
| 221 | + ], |
|
| 222 | + ], |
|
| 223 | + 20 => [ |
|
| 224 | + 0 => '/ecrire/?exec=exec&id_obj=id_obj&no_val&tab[]=1&tab[]=', |
|
| 225 | + 1 => '/ecrire/?exec=exec&id_obj=id_obj&no_val', |
|
| 226 | + 2 => 'tab[]', |
|
| 227 | + 3 => [ |
|
| 228 | + 0 => true, |
|
| 229 | + 1 => false, |
|
| 230 | + ], |
|
| 231 | + ], |
|
| 232 | + 21 => [ |
|
| 233 | + 0 => 'http://domaine/spip.php?t[]=0&t[]=2', |
|
| 234 | + 1 => 'http://domaine/spip.php?t[]=1', |
|
| 235 | + 2 => 't', |
|
| 236 | + 3 => [0, 2], |
|
| 237 | + ], |
|
| 238 | + 22 => [ |
|
| 239 | + 0 => 'http://domaine/spip.php?t[]=0&t[]=2', |
|
| 240 | + 1 => 'http://domaine/spip.php?t[]=1', |
|
| 241 | + 2 => 't[]', |
|
| 242 | + 3 => [0, 2], |
|
| 243 | + ], |
|
| 244 | + 23 => [ |
|
| 245 | + 0 => ['1', '2'], |
|
| 246 | + 1 => 'http://domaine/spip.php?t[]=1&t[]=2', |
|
| 247 | + 2 => 't', |
|
| 248 | + ], |
|
| 249 | + 24 => [ |
|
| 250 | + 0 => ['1', '2'], |
|
| 251 | + 1 => 'http://domaine/spip.php?t[]=1&t[]=2', |
|
| 252 | + 2 => 't[]', |
|
| 253 | + ], |
|
| 254 | + ]; |
|
| 255 | + } |
|
| 256 | 256 | } |
@@ -10,74 +10,74 @@ |
||
| 10 | 10 | |
| 11 | 11 | class LiensOuvrantsTest extends TestCase |
| 12 | 12 | { |
| 13 | - public static function setUpBeforeClass(): void { |
|
| 14 | - find_in_path('./inc/utils.php', '', true); |
|
| 15 | - } |
|
| 13 | + public static function setUpBeforeClass(): void { |
|
| 14 | + find_in_path('./inc/utils.php', '', true); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - #[DataProvider('providerAttendus')] |
|
| 18 | - public function testAttendus($text) { |
|
| 19 | - $link = liens_ouvrants($text); |
|
| 20 | - $this->assertEquals('_blank', extraire_attribut($link, 'target'), sprintf('Lien ouvrant "%s" n’a pas target', $link)); |
|
| 21 | - $this->assertStringContainsString('noopener', extraire_attribut($link, 'rel'), sprintf('Lien ouvrant "%s" n’a pas noopener', $link)); |
|
| 22 | - $this->assertStringContainsString('noreferrer', extraire_attribut($link, 'rel'), sprintf('Lien ouvrant "%s" n’a pas noreferrer', $link)); |
|
| 23 | - } |
|
| 17 | + #[DataProvider('providerAttendus')] |
|
| 18 | + public function testAttendus($text) { |
|
| 19 | + $link = liens_ouvrants($text); |
|
| 20 | + $this->assertEquals('_blank', extraire_attribut($link, 'target'), sprintf('Lien ouvrant "%s" n’a pas target', $link)); |
|
| 21 | + $this->assertStringContainsString('noopener', extraire_attribut($link, 'rel'), sprintf('Lien ouvrant "%s" n’a pas noopener', $link)); |
|
| 22 | + $this->assertStringContainsString('noreferrer', extraire_attribut($link, 'rel'), sprintf('Lien ouvrant "%s" n’a pas noreferrer', $link)); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public static function providerAttendus(): array { |
|
| 26 | - return [ |
|
| 27 | - 'lien spip #1' => [ |
|
| 28 | - 'text' => '<a href="https://www.spip.net/" class="spip_out">link</a>', |
|
| 29 | - ], |
|
| 30 | - 'lien spip #2' => [ |
|
| 31 | - 'text' => '<a href="https://www.spip.net/" class="spip_url">link</a>', |
|
| 32 | - ], |
|
| 33 | - ]; |
|
| 34 | - } |
|
| 25 | + public static function providerAttendus(): array { |
|
| 26 | + return [ |
|
| 27 | + 'lien spip #1' => [ |
|
| 28 | + 'text' => '<a href="https://www.spip.net/" class="spip_out">link</a>', |
|
| 29 | + ], |
|
| 30 | + 'lien spip #2' => [ |
|
| 31 | + 'text' => '<a href="https://www.spip.net/" class="spip_url">link</a>', |
|
| 32 | + ], |
|
| 33 | + ]; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - #[DataProvider('providerNonAttendus')] |
|
| 37 | - public function testNonAttendus($text) { |
|
| 38 | - $link = liens_ouvrants($text); |
|
| 39 | - $this->assertNull(extraire_attribut($link, 'target'), sprintf('Lien "%s" a un target imprevu', $link)); |
|
| 40 | - $this->assertNull(extraire_attribut($link, 'rel'), sprintf('Lien "%s" a un rel imprevu', $link)); |
|
| 41 | - } |
|
| 36 | + #[DataProvider('providerNonAttendus')] |
|
| 37 | + public function testNonAttendus($text) { |
|
| 38 | + $link = liens_ouvrants($text); |
|
| 39 | + $this->assertNull(extraire_attribut($link, 'target'), sprintf('Lien "%s" a un target imprevu', $link)); |
|
| 40 | + $this->assertNull(extraire_attribut($link, 'rel'), sprintf('Lien "%s" a un rel imprevu', $link)); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public static function providerNonAttendus(): array { |
|
| 44 | - return [ |
|
| 45 | - 'non spip #1' => [ |
|
| 46 | - 'expected' => null, |
|
| 47 | - 'text' => '<a href="https://www.spip.net/">link</a>', |
|
| 48 | - ], |
|
| 49 | - 'non spip #2' => [ |
|
| 50 | - 'expected' => null, |
|
| 51 | - 'text' => '<a href="https://www.spip.net/" class="spip_in">link</a>', |
|
| 52 | - ], |
|
| 53 | - 'non spip #3' => [ |
|
| 54 | - 'expected' => null, |
|
| 55 | - 'text' => '<a href="https://www.spip.net/" class="spip_outside">link</a>', |
|
| 56 | - ], |
|
| 57 | - 'non spip #4' => [ |
|
| 58 | - 'expected' => null, |
|
| 59 | - 'text' => '<a href="https://www.spip.net/" class="spip_urls">link</a>', |
|
| 60 | - ], |
|
| 61 | - ]; |
|
| 62 | - } |
|
| 43 | + public static function providerNonAttendus(): array { |
|
| 44 | + return [ |
|
| 45 | + 'non spip #1' => [ |
|
| 46 | + 'expected' => null, |
|
| 47 | + 'text' => '<a href="https://www.spip.net/">link</a>', |
|
| 48 | + ], |
|
| 49 | + 'non spip #2' => [ |
|
| 50 | + 'expected' => null, |
|
| 51 | + 'text' => '<a href="https://www.spip.net/" class="spip_in">link</a>', |
|
| 52 | + ], |
|
| 53 | + 'non spip #3' => [ |
|
| 54 | + 'expected' => null, |
|
| 55 | + 'text' => '<a href="https://www.spip.net/" class="spip_outside">link</a>', |
|
| 56 | + ], |
|
| 57 | + 'non spip #4' => [ |
|
| 58 | + 'expected' => null, |
|
| 59 | + 'text' => '<a href="https://www.spip.net/" class="spip_urls">link</a>', |
|
| 60 | + ], |
|
| 61 | + ]; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | |
| 65 | - #[DataProvider('providerLiensOuvrantsPropre')] |
|
| 66 | - public function testLiensOuvrantsPropre($text) { |
|
| 67 | - $link = liens_ouvrants(propre($text)); |
|
| 68 | - $this->assertEquals('_blank', extraire_attribut($link, 'target')); |
|
| 69 | - $this->assertStringContainsString('noopener', extraire_attribut($link, 'rel')); |
|
| 70 | - $this->assertStringContainsString('noreferrer', extraire_attribut($link, 'rel')); |
|
| 71 | - } |
|
| 65 | + #[DataProvider('providerLiensOuvrantsPropre')] |
|
| 66 | + public function testLiensOuvrantsPropre($text) { |
|
| 67 | + $link = liens_ouvrants(propre($text)); |
|
| 68 | + $this->assertEquals('_blank', extraire_attribut($link, 'target')); |
|
| 69 | + $this->assertStringContainsString('noopener', extraire_attribut($link, 'rel')); |
|
| 70 | + $this->assertStringContainsString('noreferrer', extraire_attribut($link, 'rel')); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - public static function providerLiensOuvrantsPropre(): array { |
|
| 74 | - return [ |
|
| 75 | - 'propre lien http' => [ |
|
| 76 | - 'text' => 'Ceci est un lien [ouvrant->http://www.spip.net/ar] rondtudiou.', |
|
| 77 | - ], |
|
| 78 | - 'propre lien https' => [ |
|
| 79 | - 'text' => 'Ceci est un lien [ouvrant->https://www.spip.net/ar] rondtudiou.', |
|
| 80 | - ] |
|
| 81 | - ]; |
|
| 82 | - } |
|
| 73 | + public static function providerLiensOuvrantsPropre(): array { |
|
| 74 | + return [ |
|
| 75 | + 'propre lien http' => [ |
|
| 76 | + 'text' => 'Ceci est un lien [ouvrant->http://www.spip.net/ar] rondtudiou.', |
|
| 77 | + ], |
|
| 78 | + 'propre lien https' => [ |
|
| 79 | + 'text' => 'Ceci est un lien [ouvrant->https://www.spip.net/ar] rondtudiou.', |
|
| 80 | + ] |
|
| 81 | + ]; |
|
| 82 | + } |
|
| 83 | 83 | } |
@@ -13,102 +13,102 @@ |
||
| 13 | 13 | |
| 14 | 14 | class UrlDeTest extends TestCase |
| 15 | 15 | { |
| 16 | - public static function setUpBeforeClass(): void { |
|
| 17 | - find_in_path('./inc/utils.php', '', true); |
|
| 18 | - } |
|
| 16 | + public static function setUpBeforeClass(): void { |
|
| 17 | + find_in_path('./inc/utils.php', '', true); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - #[DataProvider('providerUtilsUrlDe')] |
|
| 21 | - public function testUtilsUrlDe($expected, ...$args): void { |
|
| 22 | - $actual = url_de_(...$args); |
|
| 23 | - $this->assertSame($expected, $actual); |
|
| 24 | - } |
|
| 20 | + #[DataProvider('providerUtilsUrlDe')] |
|
| 21 | + public function testUtilsUrlDe($expected, ...$args): void { |
|
| 22 | + $actual = url_de_(...$args); |
|
| 23 | + $this->assertSame($expected, $actual); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public static function providerUtilsUrlDe(): array { |
|
| 27 | - return [ |
|
| 28 | - 0 => [ |
|
| 29 | - 0 => 'http://www.example.org/', |
|
| 30 | - 1 => 'http', |
|
| 31 | - 2 => 'www.example.org', |
|
| 32 | - 3 => '', |
|
| 33 | - 4 => 0, |
|
| 34 | - ], |
|
| 35 | - 1 => [ |
|
| 36 | - 0 => 'http://www.example.org/', |
|
| 37 | - 1 => 'http', |
|
| 38 | - 2 => 'www.example.org', |
|
| 39 | - 3 => '/spip.php', |
|
| 40 | - 4 => 0, |
|
| 41 | - ], |
|
| 42 | - 2 => [ |
|
| 43 | - 0 => 'http://www.example.org/', |
|
| 44 | - 1 => 'http', |
|
| 45 | - 2 => 'www.example.org', |
|
| 46 | - 3 => '/spip.php?page=demo', |
|
| 47 | - 4 => 0, |
|
| 48 | - ], |
|
| 49 | - 3 => [ |
|
| 50 | - 0 => 'http://www.example.org/sousrep/', |
|
| 51 | - 1 => 'http', |
|
| 52 | - 2 => 'www.example.org', |
|
| 53 | - 3 => '/sousrep/spip.php?page=demo', |
|
| 54 | - 4 => 0, |
|
| 55 | - ], |
|
| 56 | - 4 => [ |
|
| 57 | - 0 => 'http://www.example.org/sousrep/url/arbo/', |
|
| 58 | - 1 => 'http', |
|
| 59 | - 2 => 'www.example.org', |
|
| 60 | - 3 => '/sousrep/url/arbo/page.html', |
|
| 61 | - 4 => 0, |
|
| 62 | - ], |
|
| 63 | - 5 => [ |
|
| 64 | - 0 => 'http://www.example.org/sousrep/url/', |
|
| 65 | - 1 => 'http', |
|
| 66 | - 2 => 'www.example.org', |
|
| 67 | - 3 => '/sousrep/url/arbo/page.html', |
|
| 68 | - 4 => 1, |
|
| 69 | - ], |
|
| 70 | - 6 => [ |
|
| 71 | - 0 => 'http://www.example.org/sousrep/', |
|
| 72 | - 1 => 'http', |
|
| 73 | - 2 => 'www.example.org', |
|
| 74 | - 3 => '/sousrep/url/arbo/page.html', |
|
| 75 | - 4 => 2, |
|
| 76 | - ], |
|
| 77 | - 7 => [ |
|
| 78 | - 0 => 'http://www.example.org/', |
|
| 79 | - 1 => 'http', |
|
| 80 | - 2 => 'www.example.org', |
|
| 81 | - 3 => '/sousrep/url/arbo/page.html', |
|
| 82 | - 4 => 3, |
|
| 83 | - ], |
|
| 84 | - 8 => [ |
|
| 85 | - 0 => 'http://www.example.org/', |
|
| 86 | - 1 => 'http', |
|
| 87 | - 2 => 'www.example.org', |
|
| 88 | - 3 => '/sousrep/url/arbo/page.html', |
|
| 89 | - 4 => 4, |
|
| 90 | - ], |
|
| 91 | - 9 => [ |
|
| 92 | - 0 => 'http://www.example.org/', |
|
| 93 | - 1 => 'http', |
|
| 94 | - 2 => 'www.example.org', |
|
| 95 | - 3 => 'http://www.example.org/sousrep/url/arbo/page.html', |
|
| 96 | - 4 => 3, |
|
| 97 | - ], |
|
| 98 | - 10 => [ |
|
| 99 | - 0 => 'http://www.example.org/', |
|
| 100 | - 1 => 'http', |
|
| 101 | - 2 => 'www.example.org', |
|
| 102 | - 3 => '/?param=http://domain.tld/autre/piege/tordu', |
|
| 103 | - 4 => 3, |
|
| 104 | - ], |
|
| 105 | - 11 => [ |
|
| 106 | - 0 => 'http:///', |
|
| 107 | - 1 => 'http', |
|
| 108 | - 2 => '', |
|
| 109 | - 3 => '', |
|
| 110 | - 4 => 0, |
|
| 111 | - ], |
|
| 112 | - ]; |
|
| 113 | - } |
|
| 26 | + public static function providerUtilsUrlDe(): array { |
|
| 27 | + return [ |
|
| 28 | + 0 => [ |
|
| 29 | + 0 => 'http://www.example.org/', |
|
| 30 | + 1 => 'http', |
|
| 31 | + 2 => 'www.example.org', |
|
| 32 | + 3 => '', |
|
| 33 | + 4 => 0, |
|
| 34 | + ], |
|
| 35 | + 1 => [ |
|
| 36 | + 0 => 'http://www.example.org/', |
|
| 37 | + 1 => 'http', |
|
| 38 | + 2 => 'www.example.org', |
|
| 39 | + 3 => '/spip.php', |
|
| 40 | + 4 => 0, |
|
| 41 | + ], |
|
| 42 | + 2 => [ |
|
| 43 | + 0 => 'http://www.example.org/', |
|
| 44 | + 1 => 'http', |
|
| 45 | + 2 => 'www.example.org', |
|
| 46 | + 3 => '/spip.php?page=demo', |
|
| 47 | + 4 => 0, |
|
| 48 | + ], |
|
| 49 | + 3 => [ |
|
| 50 | + 0 => 'http://www.example.org/sousrep/', |
|
| 51 | + 1 => 'http', |
|
| 52 | + 2 => 'www.example.org', |
|
| 53 | + 3 => '/sousrep/spip.php?page=demo', |
|
| 54 | + 4 => 0, |
|
| 55 | + ], |
|
| 56 | + 4 => [ |
|
| 57 | + 0 => 'http://www.example.org/sousrep/url/arbo/', |
|
| 58 | + 1 => 'http', |
|
| 59 | + 2 => 'www.example.org', |
|
| 60 | + 3 => '/sousrep/url/arbo/page.html', |
|
| 61 | + 4 => 0, |
|
| 62 | + ], |
|
| 63 | + 5 => [ |
|
| 64 | + 0 => 'http://www.example.org/sousrep/url/', |
|
| 65 | + 1 => 'http', |
|
| 66 | + 2 => 'www.example.org', |
|
| 67 | + 3 => '/sousrep/url/arbo/page.html', |
|
| 68 | + 4 => 1, |
|
| 69 | + ], |
|
| 70 | + 6 => [ |
|
| 71 | + 0 => 'http://www.example.org/sousrep/', |
|
| 72 | + 1 => 'http', |
|
| 73 | + 2 => 'www.example.org', |
|
| 74 | + 3 => '/sousrep/url/arbo/page.html', |
|
| 75 | + 4 => 2, |
|
| 76 | + ], |
|
| 77 | + 7 => [ |
|
| 78 | + 0 => 'http://www.example.org/', |
|
| 79 | + 1 => 'http', |
|
| 80 | + 2 => 'www.example.org', |
|
| 81 | + 3 => '/sousrep/url/arbo/page.html', |
|
| 82 | + 4 => 3, |
|
| 83 | + ], |
|
| 84 | + 8 => [ |
|
| 85 | + 0 => 'http://www.example.org/', |
|
| 86 | + 1 => 'http', |
|
| 87 | + 2 => 'www.example.org', |
|
| 88 | + 3 => '/sousrep/url/arbo/page.html', |
|
| 89 | + 4 => 4, |
|
| 90 | + ], |
|
| 91 | + 9 => [ |
|
| 92 | + 0 => 'http://www.example.org/', |
|
| 93 | + 1 => 'http', |
|
| 94 | + 2 => 'www.example.org', |
|
| 95 | + 3 => 'http://www.example.org/sousrep/url/arbo/page.html', |
|
| 96 | + 4 => 3, |
|
| 97 | + ], |
|
| 98 | + 10 => [ |
|
| 99 | + 0 => 'http://www.example.org/', |
|
| 100 | + 1 => 'http', |
|
| 101 | + 2 => 'www.example.org', |
|
| 102 | + 3 => '/?param=http://domain.tld/autre/piege/tordu', |
|
| 103 | + 4 => 3, |
|
| 104 | + ], |
|
| 105 | + 11 => [ |
|
| 106 | + 0 => 'http:///', |
|
| 107 | + 1 => 'http', |
|
| 108 | + 2 => '', |
|
| 109 | + 3 => '', |
|
| 110 | + 4 => 0, |
|
| 111 | + ], |
|
| 112 | + ]; |
|
| 113 | + } |
|
| 114 | 114 | } |
@@ -10,17 +10,17 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class AbsUrlTest extends SquelettesTestCase |
| 12 | 12 | { |
| 13 | - public static function setUpBeforeClass(): void { |
|
| 14 | - find_in_path('./inc/utils.php', '', true); |
|
| 15 | - } |
|
| 13 | + public static function setUpBeforeClass(): void { |
|
| 14 | + find_in_path('./inc/utils.php', '', true); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Le filtre |abs_url doit modifier les liens a@href et img@src |
|
| 19 | - * a l'interieur d'un texte, et modifier les simples chaines de caracteres |
|
| 20 | - * quand elles proviennent de # URL_ARTICLE, mais pas ailleurs (# TITRE par ex) |
|
| 21 | - */ |
|
| 22 | - public function testAbsUrl() { |
|
| 23 | - $this->assertOkCode(<<<SPIP |
|
| 17 | + /** |
|
| 18 | + * Le filtre |abs_url doit modifier les liens a@href et img@src |
|
| 19 | + * a l'interieur d'un texte, et modifier les simples chaines de caracteres |
|
| 20 | + * quand elles proviennent de # URL_ARTICLE, mais pas ailleurs (# TITRE par ex) |
|
| 21 | + */ |
|
| 22 | + public function testAbsUrl() { |
|
| 23 | + $this->assertOkCode(<<<SPIP |
|
| 24 | 24 | <BOUCLE_a(ARTICLES){texte=='<(a|img) '}{0,1}> |
| 25 | 25 | [(#URL_ARTICLE |
| 26 | 26 | |abs_url |
@@ -40,6 +40,6 @@ discard block |
||
| 40 | 40 | OK |
| 41 | 41 | <//B_a> |
| 42 | 42 | SPIP); |
| 43 | - } |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | 45 | } |