From e99bd53444c2022675195565aaa5129e8186c833 Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Mon, 13 Mar 2023 14:49:59 +0100 Subject: [PATCH] =?UTF-8?q?tests:=20modif=20des=20jeux=20de=20test=20pour?= =?UTF-8?q?=20tester=20les=20cas=20'0',=200,=20null=20et=20array=20vide=20?= =?UTF-8?q?en=20entr=C3=A9e=20de=20propre=20et=20s'assurer=20que=20toute?= =?UTF-8?q?=20chaine=20non=20vide=20est=20bien=20paragraph=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Texte/PropreTest.php | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/Texte/PropreTest.php b/tests/Texte/PropreTest.php index 0b8b908046..6cf8bc3f41 100644 --- a/tests/Texte/PropreTest.php +++ b/tests/Texte/PropreTest.php @@ -47,36 +47,48 @@ class PropreTest extends TestCase public function providerTextePropre(): array { return [ - 0 => [ + 'vide' => [ 0 => '', 1 => '', ], - 1 => [ - 0 => '0', + 'null' => [ + 0 => '', + 1 => null, + ], + 'array' => [ + 0 => '', + 1 => [], + ], + 'chaine_zero' => [ + 0 => '<p>0</p>', 1 => '0', ], - 2 => [ + 'nombre_zero' => [ + 0 => '<p>0</p>', + 1 => 0, + ], + 'string_1' => [ 0 => '<p>Un texte avec des <a href="http://spip.net">liens</a> <a href="spip.php?article1" class="spip_in">Article 1</a> <a href="http://www.spip.net" class="spip_out" rel="external">spip</a> <a href="http://www.spip.net" class="spip_url spip_out auto" rel="nofollow external">http://www.spip.net</a></p>', 1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net', ], - 3 => [ + 'string_2' => [ 0 => '<p>Un texte avec des entités &<>"</p>', 1 => 'Un texte avec des entités &<>"', ], - 4 => [ + 'string_3' => [ 0 => '<p>Un texte sans entites &<>"’</p>', 1 => 'Un texte sans entites &<>"\'', ], - 5 => [ + 'string_4' => [ 0 => '<h2 class="spip">Des raccourcis</h2> <p> <i>italique</i> <strong>gras</strong> <code class="spip_code spip_code_inline" dir="ltr">du code</code></p>', 1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>', ], - 6 => [ + 'string_5' => [ 0 => '<p>Un modele <tt><modeleinexistant|lien=[->http://www.spip.net]></tt></p>', 1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>', ], - 7 => [ + 'string_6' => [ 0 => '<p><span class="spip-puce ltr"><b>–</b></span> propre</p>', 1 => '- propre', ], -- GitLab