Skip to content
Extraits de code Groupes Projets
Valider 92272ad2 rédigé par marcimat's avatar marcimat Validation de marcimat
Parcourir les fichiers

tests: Ajouter un tests d’insertion d’attribut dans IMG autre que alt

parent ac09e522
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -60,6 +60,12 @@ class InsererAttributTest extends TestCase ...@@ -60,6 +60,12 @@ class InsererAttributTest extends TestCase
$this->assertSame($expected, $actual); $this->assertSame($expected, $actual);
} }
#[DataProvider('providerFiltresInsererAttributLienImgAutres')]
public function testFiltresInsererAttributLienImgAutres($expected, ...$args): void {
$actual = inserer_attribut(...$args);
$this->assertSame($expected, $actual);
}
#[DataProvider('providerFiltresInsererAttributAutres')] #[DataProvider('providerFiltresInsererAttributAutres')]
public function testFiltresInsererAttributAutres($expected, ...$args): void { public function testFiltresInsererAttributAutres($expected, ...$args): void {
$actual = inserer_attribut(...$args); $actual = inserer_attribut(...$args);
...@@ -753,6 +759,109 @@ paragraphes', ...@@ -753,6 +759,109 @@ paragraphes',
]; ];
} }
public static function providerFiltresInsererAttributLienImgAutres(): array {
return [
0 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
2 => 'data-truc',
3 => '',
4 => true,
5 => true,
],
1 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '',
4 => true,
5 => true,
],
2 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc=''></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '',
4 => true,
5 => false,
],
3 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='' /></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
2 => 'data-truc',
3 => '',
4 => true,
5 => false,
],
4 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '',
4 => false,
5 => true,
],
5 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
2 => 'data-truc',
3 => '',
4 => false,
5 => true,
],
6 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc=''></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '',
4 => false,
5 => false,
],
7 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='' /></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' /></a>",
2 => 'data-truc',
3 => '',
4 => false,
5 => false,
],
8 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='0'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '0',
4 => true,
5 => true,
],
9 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='0'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '0',
4 => true,
5 => false,
],
10 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='0'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '0',
4 => false,
5 => true,
],
11 => [
0 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png' data-truc='0'></a>",
1 => "<a href='https://www.spip.net'><img src='https://www.spip.net/IMG/logo/siteon0.png'></a>",
2 => 'data-truc',
3 => '0',
4 => false,
5 => false,
],
];
}
public static function providerFiltresInsererAttributAutres(): array { public static function providerFiltresInsererAttributAutres(): array {
return [ return [
72 => [ 72 => [
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter