Completed
Push — master ( 9d5840...11381c )
by cam
01:51
created
ecrire/tests/Filtre/LienOuExposeTest.php 1 patch
Indentation   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -13,200 +13,200 @@
 block discarded – undo
13 13
 
14 14
 class LienOuExposeTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('./inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('./inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresLienOuExpose')]
21
-	public function testFiltresLienOuExpose($expected, ...$args): void {
22
-		$actual = lien_ou_expose(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresLienOuExpose')]
21
+    public function testFiltresLienOuExpose($expected, ...$args): void {
22
+        $actual = lien_ou_expose(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresLienOuExpose(): array {
27
-		return [
28
-			0 => [
29
-				0 => '<strong class="on">libelle</strong>',
30
-				1 => 'http://www.spip.net/',
31
-				2 => 'libelle',
32
-				3 => true,
33
-			],
34
-			1 => [
35
-				0 => "<a href='http://www.spip.net/'>libelle</a>",
36
-				1 => 'http://www.spip.net/',
37
-				2 => 'libelle',
38
-				3 => false,
39
-			],
40
-			2 => [
41
-				0 => '<strong class="on">0</strong>',
42
-				1 => 'http://www.spip.net/',
43
-				2 => 0,
44
-				3 => true,
45
-			],
46
-			3 => [
47
-				0 => '<strong class="on">-1</strong>',
48
-				1 => 'http://www.spip.net/',
49
-				2 => -1,
50
-				3 => true,
51
-			],
52
-			4 => [
53
-				0 => '<strong class="on">1</strong>',
54
-				1 => 'http://www.spip.net/',
55
-				2 => 1,
56
-				3 => true,
57
-			],
58
-			5 => [
59
-				0 => '<strong class="on">2</strong>',
60
-				1 => 'http://www.spip.net/',
61
-				2 => 2,
62
-				3 => true,
63
-			],
64
-			6 => [
65
-				0 => '<strong class="on">3</strong>',
66
-				1 => 'http://www.spip.net/',
67
-				2 => 3,
68
-				3 => true,
69
-			],
70
-			7 => [
71
-				0 => '<strong class="on">4</strong>',
72
-				1 => 'http://www.spip.net/',
73
-				2 => 4,
74
-				3 => true,
75
-			],
76
-			8 => [
77
-				0 => '<strong class="on">5</strong>',
78
-				1 => 'http://www.spip.net/',
79
-				2 => 5,
80
-				3 => true,
81
-			],
82
-			9 => [
83
-				0 => '<strong class="on">6</strong>',
84
-				1 => 'http://www.spip.net/',
85
-				2 => 6,
86
-				3 => true,
87
-			],
88
-			10 => [
89
-				0 => '<strong class="on">7</strong>',
90
-				1 => 'http://www.spip.net/',
91
-				2 => 7,
92
-				3 => true,
93
-			],
94
-			11 => [
95
-				0 => '<strong class="on">10</strong>',
96
-				1 => 'http://www.spip.net/',
97
-				2 => 10,
98
-				3 => true,
99
-			],
100
-			12 => [
101
-				0 => '<strong class="on">20</strong>',
102
-				1 => 'http://www.spip.net/',
103
-				2 => 20,
104
-				3 => true,
105
-			],
106
-			13 => [
107
-				0 => '<strong class="on">30</strong>',
108
-				1 => 'http://www.spip.net/',
109
-				2 => 30,
110
-				3 => true,
111
-			],
112
-			14 => [
113
-				0 => '<strong class="on">50</strong>',
114
-				1 => 'http://www.spip.net/',
115
-				2 => 50,
116
-				3 => true,
117
-			],
118
-			15 => [
119
-				0 => '<strong class="on">100</strong>',
120
-				1 => 'http://www.spip.net/',
121
-				2 => 100,
122
-				3 => true,
123
-			],
124
-			16 => [
125
-				0 => '<strong class="on">1000</strong>',
126
-				1 => 'http://www.spip.net/',
127
-				2 => 1000,
128
-				3 => true,
129
-			],
130
-			17 => [
131
-				0 => '<strong class="on">10000</strong>',
132
-				1 => 'http://www.spip.net/',
133
-				2 => 10000,
134
-				3 => true,
135
-			],
136
-			18 => [
137
-				0 => '<strong class="on">0</strong>',
138
-				1 => 'http://www.spip.net/',
139
-				2 => '0',
140
-				3 => true,
141
-			],
142
-			19 => [
143
-				0 => '<strong class="on">SPIP</strong>',
144
-				1 => 'http://www.spip.net/',
145
-				2 => 'SPIP',
146
-				3 => true,
147
-				4 => 'lien',
148
-			],
149
-			20 => [
150
-				0 => "<a href='http://www.spip.net/' class='lien'>SPIP</a>",
151
-				1 => 'http://www.spip.net/',
152
-				2 => 'SPIP',
153
-				3 => false,
154
-				4 => 'lien',
155
-			],
156
-			21 => [
157
-				0 => '<strong class="on">SPIP</strong>',
158
-				1 => 'http://www.spip.net/',
159
-				2 => 'SPIP',
160
-				3 => true,
161
-				4 => '',
162
-				5 => 'titre',
163
-			],
164
-			22 => [
165
-				0 => "<a href='http://www.spip.net/' title='titre'>SPIP</a>",
166
-				1 => 'http://www.spip.net/',
167
-				2 => 'SPIP',
168
-				3 => false,
169
-				4 => '',
170
-				5 => 'titre',
171
-			],
172
-			23 => [
173
-				0 => '<strong class="on">SPIP</strong>',
174
-				1 => 'http://www.spip.net/',
175
-				2 => 'SPIP',
176
-				3 => true,
177
-				4 => '',
178
-				5 => '',
179
-				6 => 'prev',
180
-			],
181
-			24 => [
182
-				0 => "<a href='http://www.spip.net/' rel='prev'>SPIP</a>",
183
-				1 => 'http://www.spip.net/',
184
-				2 => 'SPIP',
185
-				3 => false,
186
-				4 => '',
187
-				5 => '',
188
-				6 => 'prev',
189
-			],
190
-			25 => [
191
-				0 => '<strong class="on">SPIP</strong>',
192
-				1 => 'http://www.spip.net/',
193
-				2 => 'SPIP',
194
-				3 => true,
195
-				4 => '',
196
-				5 => '',
197
-				6 => '',
198
-				7 => ' onclick="alert(\'toto\');"',
199
-			],
200
-			26 => [
201
-				0 => '<a href=\'http://www.spip.net/\' onclick="alert(\'toto\');">SPIP</a>',
202
-				1 => 'http://www.spip.net/',
203
-				2 => 'SPIP',
204
-				3 => false,
205
-				4 => '',
206
-				5 => '',
207
-				6 => '',
208
-				7 => ' onclick="alert(\'toto\');"',
209
-			],
210
-		];
211
-	}
26
+    public static function providerFiltresLienOuExpose(): array {
27
+        return [
28
+            0 => [
29
+                0 => '<strong class="on">libelle</strong>',
30
+                1 => 'http://www.spip.net/',
31
+                2 => 'libelle',
32
+                3 => true,
33
+            ],
34
+            1 => [
35
+                0 => "<a href='http://www.spip.net/'>libelle</a>",
36
+                1 => 'http://www.spip.net/',
37
+                2 => 'libelle',
38
+                3 => false,
39
+            ],
40
+            2 => [
41
+                0 => '<strong class="on">0</strong>',
42
+                1 => 'http://www.spip.net/',
43
+                2 => 0,
44
+                3 => true,
45
+            ],
46
+            3 => [
47
+                0 => '<strong class="on">-1</strong>',
48
+                1 => 'http://www.spip.net/',
49
+                2 => -1,
50
+                3 => true,
51
+            ],
52
+            4 => [
53
+                0 => '<strong class="on">1</strong>',
54
+                1 => 'http://www.spip.net/',
55
+                2 => 1,
56
+                3 => true,
57
+            ],
58
+            5 => [
59
+                0 => '<strong class="on">2</strong>',
60
+                1 => 'http://www.spip.net/',
61
+                2 => 2,
62
+                3 => true,
63
+            ],
64
+            6 => [
65
+                0 => '<strong class="on">3</strong>',
66
+                1 => 'http://www.spip.net/',
67
+                2 => 3,
68
+                3 => true,
69
+            ],
70
+            7 => [
71
+                0 => '<strong class="on">4</strong>',
72
+                1 => 'http://www.spip.net/',
73
+                2 => 4,
74
+                3 => true,
75
+            ],
76
+            8 => [
77
+                0 => '<strong class="on">5</strong>',
78
+                1 => 'http://www.spip.net/',
79
+                2 => 5,
80
+                3 => true,
81
+            ],
82
+            9 => [
83
+                0 => '<strong class="on">6</strong>',
84
+                1 => 'http://www.spip.net/',
85
+                2 => 6,
86
+                3 => true,
87
+            ],
88
+            10 => [
89
+                0 => '<strong class="on">7</strong>',
90
+                1 => 'http://www.spip.net/',
91
+                2 => 7,
92
+                3 => true,
93
+            ],
94
+            11 => [
95
+                0 => '<strong class="on">10</strong>',
96
+                1 => 'http://www.spip.net/',
97
+                2 => 10,
98
+                3 => true,
99
+            ],
100
+            12 => [
101
+                0 => '<strong class="on">20</strong>',
102
+                1 => 'http://www.spip.net/',
103
+                2 => 20,
104
+                3 => true,
105
+            ],
106
+            13 => [
107
+                0 => '<strong class="on">30</strong>',
108
+                1 => 'http://www.spip.net/',
109
+                2 => 30,
110
+                3 => true,
111
+            ],
112
+            14 => [
113
+                0 => '<strong class="on">50</strong>',
114
+                1 => 'http://www.spip.net/',
115
+                2 => 50,
116
+                3 => true,
117
+            ],
118
+            15 => [
119
+                0 => '<strong class="on">100</strong>',
120
+                1 => 'http://www.spip.net/',
121
+                2 => 100,
122
+                3 => true,
123
+            ],
124
+            16 => [
125
+                0 => '<strong class="on">1000</strong>',
126
+                1 => 'http://www.spip.net/',
127
+                2 => 1000,
128
+                3 => true,
129
+            ],
130
+            17 => [
131
+                0 => '<strong class="on">10000</strong>',
132
+                1 => 'http://www.spip.net/',
133
+                2 => 10000,
134
+                3 => true,
135
+            ],
136
+            18 => [
137
+                0 => '<strong class="on">0</strong>',
138
+                1 => 'http://www.spip.net/',
139
+                2 => '0',
140
+                3 => true,
141
+            ],
142
+            19 => [
143
+                0 => '<strong class="on">SPIP</strong>',
144
+                1 => 'http://www.spip.net/',
145
+                2 => 'SPIP',
146
+                3 => true,
147
+                4 => 'lien',
148
+            ],
149
+            20 => [
150
+                0 => "<a href='http://www.spip.net/' class='lien'>SPIP</a>",
151
+                1 => 'http://www.spip.net/',
152
+                2 => 'SPIP',
153
+                3 => false,
154
+                4 => 'lien',
155
+            ],
156
+            21 => [
157
+                0 => '<strong class="on">SPIP</strong>',
158
+                1 => 'http://www.spip.net/',
159
+                2 => 'SPIP',
160
+                3 => true,
161
+                4 => '',
162
+                5 => 'titre',
163
+            ],
164
+            22 => [
165
+                0 => "<a href='http://www.spip.net/' title='titre'>SPIP</a>",
166
+                1 => 'http://www.spip.net/',
167
+                2 => 'SPIP',
168
+                3 => false,
169
+                4 => '',
170
+                5 => 'titre',
171
+            ],
172
+            23 => [
173
+                0 => '<strong class="on">SPIP</strong>',
174
+                1 => 'http://www.spip.net/',
175
+                2 => 'SPIP',
176
+                3 => true,
177
+                4 => '',
178
+                5 => '',
179
+                6 => 'prev',
180
+            ],
181
+            24 => [
182
+                0 => "<a href='http://www.spip.net/' rel='prev'>SPIP</a>",
183
+                1 => 'http://www.spip.net/',
184
+                2 => 'SPIP',
185
+                3 => false,
186
+                4 => '',
187
+                5 => '',
188
+                6 => 'prev',
189
+            ],
190
+            25 => [
191
+                0 => '<strong class="on">SPIP</strong>',
192
+                1 => 'http://www.spip.net/',
193
+                2 => 'SPIP',
194
+                3 => true,
195
+                4 => '',
196
+                5 => '',
197
+                6 => '',
198
+                7 => ' onclick="alert(\'toto\');"',
199
+            ],
200
+            26 => [
201
+                0 => '<a href=\'http://www.spip.net/\' onclick="alert(\'toto\');">SPIP</a>',
202
+                1 => 'http://www.spip.net/',
203
+                2 => 'SPIP',
204
+                3 => false,
205
+                4 => '',
206
+                5 => '',
207
+                6 => '',
208
+                7 => ' onclick="alert(\'toto\');"',
209
+            ],
210
+        ];
211
+    }
212 212
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/RecupererNumeroTest.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -13,42 +13,42 @@
 block discarded – undo
13 13
 
14 14
 class RecupererNumeroTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresRecupererNumero')]
21
-	public function testFiltresRecupererNumero($expected, ...$args): void {
22
-		$actual = recuperer_numero(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresRecupererNumero')]
21
+    public function testFiltresRecupererNumero($expected, ...$args): void {
22
+        $actual = recuperer_numero(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresRecupererNumero(): array {
27
-		return [
28
-			0 => [
29
-				0 => '1',
30
-				1 => '1. titre',
31
-			],
32
-			1 => [
33
-				0 => '',
34
-				1 => '1.titre',
35
-			],
36
-			2 => [
37
-				0 => '',
38
-				1 => '1 .titre',
39
-			],
40
-			3 => [
41
-				0 => '',
42
-				1 => '1 . titre',
43
-			],
44
-			4 => [
45
-				0 => '0',
46
-				1 => '0. titre',
47
-			],
48
-			5 => [
49
-				0 => '',
50
-				1 => '-1. titre',
51
-			],
52
-		];
53
-	}
26
+    public static function providerFiltresRecupererNumero(): array {
27
+        return [
28
+            0 => [
29
+                0 => '1',
30
+                1 => '1. titre',
31
+            ],
32
+            1 => [
33
+                0 => '',
34
+                1 => '1.titre',
35
+            ],
36
+            2 => [
37
+                0 => '',
38
+                1 => '1 .titre',
39
+            ],
40
+            3 => [
41
+                0 => '',
42
+                1 => '1 . titre',
43
+            ],
44
+            4 => [
45
+                0 => '0',
46
+                1 => '0. titre',
47
+            ],
48
+            5 => [
49
+                0 => '',
50
+                1 => '-1. titre',
51
+            ],
52
+        ];
53
+    }
54 54
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/EchapperTagsTest.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -13,46 +13,46 @@
 block discarded – undo
13 13
 
14 14
 class EchapperTagsTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresEchapperTags')]
21
-	public function testFiltresEchapperTags($expected, ...$args): void {
22
-		$actual = echapper_tags(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresEchapperTags')]
21
+    public function testFiltresEchapperTags($expected, ...$args): void {
22
+        $actual = echapper_tags(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresEchapperTags(): array {
27
-		return [
28
-			0 => [
29
-				0 => '',
30
-				1 => '',
31
-			],
32
-			1 => [
33
-				0 => '0',
34
-				1 => '0',
35
-			],
36
-			2 => [
37
-				0 => 'Un texte avec des &lt;a href="http://spip.net"&gt;liens&lt;/a&gt; [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
38
-				1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
39
-			],
40
-			3 => [
41
-				0 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
42
-				1 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
43
-			],
44
-			4 => [
45
-				0 => 'Un texte sans entites &&lt;&gt;"\'',
46
-				1 => 'Un texte sans entites &<>"\'',
47
-			],
48
-			5 => [
49
-				0 => '{{{Des raccourcis}}} {italique} {{gras}} &lt;code&gt;du code&lt;/code&gt;',
50
-				1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
51
-			],
52
-			6 => [
53
-				0 => 'Un modele &lt;modeleinexistant|lien=[-&gt;http://www.spip.net]>',
54
-				1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>',
55
-			],
56
-		];
57
-	}
26
+    public static function providerFiltresEchapperTags(): array {
27
+        return [
28
+            0 => [
29
+                0 => '',
30
+                1 => '',
31
+            ],
32
+            1 => [
33
+                0 => '0',
34
+                1 => '0',
35
+            ],
36
+            2 => [
37
+                0 => 'Un texte avec des &lt;a href="http://spip.net"&gt;liens&lt;/a&gt; [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
38
+                1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
39
+            ],
40
+            3 => [
41
+                0 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
42
+                1 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
43
+            ],
44
+            4 => [
45
+                0 => 'Un texte sans entites &&lt;&gt;"\'',
46
+                1 => 'Un texte sans entites &<>"\'',
47
+            ],
48
+            5 => [
49
+                0 => '{{{Des raccourcis}}} {italique} {{gras}} &lt;code&gt;du code&lt;/code&gt;',
50
+                1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
51
+            ],
52
+            6 => [
53
+                0 => 'Un modele &lt;modeleinexistant|lien=[-&gt;http://www.spip.net]>',
54
+                1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>',
55
+            ],
56
+        ];
57
+    }
58 58
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/AppliquerFiltreTest.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,28 +13,28 @@
 block discarded – undo
13 13
 
14 14
 class AppliquerFiltreTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresAppliquerFiltre')]
21
-	public function testFiltresAppliquerFiltre($expected, ...$args): void {
22
-		$actual = appliquer_filtre(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresAppliquerFiltre')]
21
+    public function testFiltresAppliquerFiltre($expected, ...$args): void {
22
+        $actual = appliquer_filtre(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresAppliquerFiltre(): array {
27
-		return [
28
-			0 => [
29
-				0 => '&lt;&gt;&quot;&#039;&amp;',
30
-				1 => '<>"\'&',
31
-				2 => 'entites_html',
32
-			],
33
-			1 => [
34
-				0 => '&amp;',
35
-				1 => '&amp;',
36
-				2 => 'entites_html',
37
-			],
38
-		];
39
-	}
26
+    public static function providerFiltresAppliquerFiltre(): array {
27
+        return [
28
+            0 => [
29
+                0 => '&lt;&gt;&quot;&#039;&amp;',
30
+                1 => '<>"\'&',
31
+                2 => 'entites_html',
32
+            ],
33
+            1 => [
34
+                0 => '&amp;',
35
+                1 => '&amp;',
36
+                2 => 'entites_html',
37
+            ],
38
+        ];
39
+    }
40 40
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/WrapTest.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,33 +13,33 @@
 block discarded – undo
13 13
 
14 14
 class WrapTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresWrap')]
21
-	public function testFiltresWrap($expected, ...$args): void {
22
-		$actual = wrap(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresWrap')]
21
+    public function testFiltresWrap($expected, ...$args): void {
22
+        $actual = wrap(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresWrap(): array {
27
-		return [
28
-			0 => [
29
-				0 => '<h3>un mot</h3>',
30
-				1 => 'un mot',
31
-				2 => '<h3>',
32
-			],
33
-			1 => [
34
-				0 => '<h3><b>un mot</b></h3>',
35
-				1 => 'un mot',
36
-				2 => '<h3><b>',
37
-			],
38
-			2 => [
39
-				0 => '<h3 class="spip"><b>un mot</b></h3>',
40
-				1 => 'un mot',
41
-				2 => '<h3 class="spip"><b>',
42
-			],
43
-		];
44
-	}
26
+    public static function providerFiltresWrap(): array {
27
+        return [
28
+            0 => [
29
+                0 => '<h3>un mot</h3>',
30
+                1 => 'un mot',
31
+                2 => '<h3>',
32
+            ],
33
+            1 => [
34
+                0 => '<h3><b>un mot</b></h3>',
35
+                1 => 'un mot',
36
+                2 => '<h3><b>',
37
+            ],
38
+            2 => [
39
+                0 => '<h3 class="spip"><b>un mot</b></h3>',
40
+                1 => 'un mot',
41
+                2 => '<h3 class="spip"><b>',
42
+            ],
43
+        ];
44
+    }
45 45
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/TexteBackendTest.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -13,46 +13,46 @@
 block discarded – undo
13 13
 
14 14
 class TexteBackendTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresTexteBackend')]
21
-	public function testFiltresTexteBackend($expected, ...$args): void {
22
-		$actual = texte_backend(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresTexteBackend')]
21
+    public function testFiltresTexteBackend($expected, ...$args): void {
22
+        $actual = texte_backend(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresTexteBackend(): array {
27
-		return [
28
-			0 => [
29
-				0 => '',
30
-				1 => '',
31
-			],
32
-			1 => [
33
-				0 => '0',
34
-				1 => '0',
35
-			],
36
-			2 => [
37
-				0 => 'Un texte avec des &lt;a href=&#034;http://spip.net&#034;&gt;liens&lt;/a&gt; [Article 1-&gt;art1] [spip-&gt;http://www.spip.net] http://www.spip.net',
38
-				1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
39
-			],
40
-			3 => [
41
-				0 => 'Un texte avec des entit&#233;s &amp;&lt;&gt;&#034;',
42
-				1 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
43
-			],
44
-			4 => [
45
-				0 => "Un texte sans entites &amp;&lt;&gt;&#034;'",
46
-				1 => 'Un texte sans entites &<>"\'',
47
-			],
48
-			5 => [
49
-				0 => '{{{Des raccourcis}}} {italique} {{gras}} &lt;code&gt;du code&lt;/code&gt;',
50
-				1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
51
-			],
52
-			6 => [
53
-				0 => 'Un modele &lt;modeleinexistant|lien=[-&gt;http://www.spip.net]&gt;',
54
-				1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>',
55
-			],
56
-		];
57
-	}
26
+    public static function providerFiltresTexteBackend(): array {
27
+        return [
28
+            0 => [
29
+                0 => '',
30
+                1 => '',
31
+            ],
32
+            1 => [
33
+                0 => '0',
34
+                1 => '0',
35
+            ],
36
+            2 => [
37
+                0 => 'Un texte avec des &lt;a href=&#034;http://spip.net&#034;&gt;liens&lt;/a&gt; [Article 1-&gt;art1] [spip-&gt;http://www.spip.net] http://www.spip.net',
38
+                1 => 'Un texte avec des <a href="http://spip.net">liens</a> [Article 1->art1] [spip->http://www.spip.net] http://www.spip.net',
39
+            ],
40
+            3 => [
41
+                0 => 'Un texte avec des entit&#233;s &amp;&lt;&gt;&#034;',
42
+                1 => 'Un texte avec des entit&eacute;s &amp;&lt;&gt;&quot;',
43
+            ],
44
+            4 => [
45
+                0 => "Un texte sans entites &amp;&lt;&gt;&#034;'",
46
+                1 => 'Un texte sans entites &<>"\'',
47
+            ],
48
+            5 => [
49
+                0 => '{{{Des raccourcis}}} {italique} {{gras}} &lt;code&gt;du code&lt;/code&gt;',
50
+                1 => '{{{Des raccourcis}}} {italique} {{gras}} <code>du code</code>',
51
+            ],
52
+            6 => [
53
+                0 => 'Un modele &lt;modeleinexistant|lien=[-&gt;http://www.spip.net]&gt;',
54
+                1 => 'Un modele <modeleinexistant|lien=[->http://www.spip.net]>',
55
+            ],
56
+        ];
57
+    }
58 58
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/AntispamTest.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@
 block discarded – undo
12 12
 
13 13
 class AntispamTest extends TestCase
14 14
 {
15
-	public static function setUpBeforeClass(): void {
16
-		find_in_path('inc/filtres.php', '', true);
17
-	}
15
+    public static function setUpBeforeClass(): void {
16
+        find_in_path('inc/filtres.php', '', true);
17
+    }
18 18
 
19
-	public function testFiltresAntispam(): void {
20
-		$actual = antispam('[email protected]');
21
-		$this->assertStringNotContainsString('@', $actual);
22
-	}
19
+    public function testFiltresAntispam(): void {
20
+        $actual = antispam('[email protected]');
21
+        $this->assertStringNotContainsString('@', $actual);
22
+    }
23 23
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/ChercherFiltreTest.php 1 patch
Indentation   +458 added lines, -458 removed lines patch added patch discarded remove patch
@@ -13,464 +13,464 @@
 block discarded – undo
13 13
 
14 14
 class ChercherFiltreTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('inc/filtres.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('inc/filtres.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerFiltresChercherFiltre')]
21
-	public function testFiltresChercherFiltre($expected, ...$args): void {
22
-		$actual = chercher_filtre(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerFiltresChercherFiltre')]
21
+    public function testFiltresChercherFiltre($expected, ...$args): void {
22
+        $actual = chercher_filtre(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerFiltresChercherFiltre(): array {
27
-		return [
28
-			0 => [
29
-				0 => 'filtre_identite_dist',
30
-				1 => 'identite',
31
-			],
32
-			1 => [
33
-				0 => 'identite',
34
-				1 => 'zzhkezhkf',
35
-				2 => 'identite',
36
-			],
37
-			3 => [
38
-				0 => 'identite',
39
-				1 => null,
40
-				2 => 'identite',
41
-			],
42
-			4 => [
43
-				0 => 'filtre_text_dist',
44
-				1 => 'text',
45
-			],
46
-			5 => [
47
-				0 => 'filtre_implode_dist',
48
-				1 => 'implode',
49
-			],
50
-			6 => [
51
-				0 => 'filtre_image_dist',
52
-				1 => 'image/jpeg',
53
-			],
54
-			7 => [
55
-				0 => 'filtre_image_dist',
56
-				1 => 'image/png',
57
-			],
58
-			8 => [
59
-				0 => 'filtre_image_dist',
60
-				1 => 'image/gif',
61
-			],
62
-			9 => [
63
-				0 => 'filtre_image_dist',
64
-				1 => 'image/x-ms-bmp',
65
-			],
66
-			10 => [
67
-				0 => 'filtre_image_dist',
68
-				1 => 'image/tiff',
69
-			],
70
-			11 => [
71
-				0 => 'filtre_audio_dist',
72
-				1 => 'audio/x-aiff',
73
-			],
74
-			12 => [
75
-				0 => 'filtre_video_dist',
76
-				1 => 'video/x-ms-asf',
77
-			],
78
-			13 => [
79
-				0 => 'filtre_video_dist',
80
-				1 => 'video/x-msvideo',
81
-			],
82
-			14 => [
83
-				0 => 'filtre_application_dist',
84
-				1 => 'application/annodex',
85
-			],
86
-			15 => [
87
-				0 => 'filtre_audio_dist',
88
-				1 => 'audio/annodex',
89
-			],
90
-			16 => [
91
-				0 => 'filtre_video_dist',
92
-				1 => 'video/annodex',
93
-			],
94
-			17 => [
95
-				0 => 'filtre_video_dist',
96
-				1 => 'video/x-dv',
97
-			],
98
-			18 => [
99
-				0 => 'filtre_audio_dist',
100
-				1 => 'audio/x-flac',
101
-			],
102
-			19 => [
103
-				0 => 'filtre_video_dist',
104
-				1 => 'video/x-flv',
105
-			],
106
-			20 => [
107
-				0 => 'filtre_audio_dist',
108
-				1 => 'audio/mp4a-latm',
109
-			],
110
-			23 => [
111
-				0 => 'filtre_video_dist',
112
-				1 => 'video/vnd.mpegurl',
113
-			],
114
-			24 => [
115
-				0 => 'filtre_video_dist',
116
-				1 => 'video/x-m4v',
117
-			],
118
-			25 => [
119
-				0 => 'filtre_audio_dist',
120
-				1 => 'audio/midi',
121
-			],
122
-			26 => [
123
-				0 => 'filtre_audio_dist',
124
-				1 => 'audio/mka',
125
-			],
126
-			27 => [
127
-				0 => 'filtre_video_dist',
128
-				1 => 'video/mkv',
129
-			],
130
-			28 => [
131
-				0 => 'filtre_video_dist',
132
-				1 => 'video/x-mng',
133
-			],
134
-			29 => [
135
-				0 => 'filtre_video_dist',
136
-				1 => 'video/quicktime',
137
-			],
138
-			30 => [
139
-				0 => 'filtre_audio_dist',
140
-				1 => 'audio/mpeg',
141
-			],
142
-			31 => [
143
-				0 => 'filtre_application_dist',
144
-				1 => 'application/mp4',
145
-			],
146
-			32 => [
147
-				0 => 'filtre_video_dist',
148
-				1 => 'video/mpeg',
149
-			],
150
-			33 => [
151
-				0 => 'filtre_audio_dist',
152
-				1 => 'audio/ogg',
153
-			],
154
-			34 => [
155
-				0 => 'filtre_audio_dist',
156
-				1 => 'audio/ogg ',
157
-			],
158
-			35 => [
159
-				0 => 'filtre_video_dist',
160
-				1 => 'video/ogg ',
161
-			],
162
-			36 => [
163
-				0 => 'filtre_application_dist',
164
-				1 => 'application/ogg ',
165
-			],
166
-			38 => [
167
-				0 => 'filtre_audio_x_pn_realaudio',
168
-				1 => 'audio/x-pn-realaudio',
169
-			],
170
-			42 => [
171
-				0 => 'filtre_image_dist',
172
-				1 => 'image/svg+xml',
173
-			],
174
-			43 => [
175
-				0 => 'filtre_application_dist',
176
-				1 => 'application/x-shockwave-flash',
177
-			],
178
-			44 => [
179
-				0 => 'filtre_audio_dist',
180
-				1 => 'audio/x-wav',
181
-			],
182
-			45 => [
183
-				0 => 'filtre_video_dist',
184
-				1 => 'video/x-ms-wmv',
185
-			],
186
-			46 => [
187
-				0 => 'filtre_video_dist',
188
-				1 => 'video/3gpp',
189
-			],
190
-			47 => [
191
-				0 => 'filtre_application_dist',
192
-				1 => 'application/illustrator',
193
-			],
194
-			48 => [
195
-				0 => 'filtre_application_dist',
196
-				1 => 'application/abiword',
197
-			],
198
-			49 => [
199
-				0 => 'filtre_application_dist',
200
-				1 => 'application/octet-stream',
201
-			],
202
-			50 => [
203
-				0 => 'filtre_application_dist',
204
-				1 => 'application/x-blender',
205
-			],
206
-			51 => [
207
-				0 => 'filtre_application_dist',
208
-				1 => 'application/x-bzip2',
209
-			],
210
-			52 => [
211
-				0 => 'filtre_text_dist',
212
-				1 => 'text/x-csrc',
213
-			],
214
-			53 => [
215
-				0 => 'filtre_text_dist',
216
-				1 => 'text/css',
217
-			],
218
-			54 => [
219
-				0 => 'filtre_text_csv_dist',
220
-				1 => 'text/csv',
221
-			],
222
-			55 => [
223
-				0 => 'filtre_application_dist',
224
-				1 => 'application/x-debian-package',
225
-			],
226
-			56 => [
227
-				0 => 'filtre_application_dist',
228
-				1 => 'application/msword',
229
-			],
230
-			57 => [
231
-				0 => 'filtre_image_dist',
232
-				1 => 'image/vnd.djvu',
233
-			],
234
-			58 => [
235
-				0 => 'filtre_application_dist',
236
-				1 => 'application/x-dvi',
237
-			],
238
-			59 => [
239
-				0 => 'filtre_application_dist',
240
-				1 => 'application/postscript',
241
-			],
242
-			60 => [
243
-				0 => 'filtre_application_dist',
244
-				1 => 'application/x-gzip',
245
-			],
246
-			61 => [
247
-				0 => 'filtre_text_dist',
248
-				1 => 'text/x-chdr',
249
-			],
250
-			62 => [
251
-				0 => 'filtre_text_html_dist',
252
-				1 => 'text/html',
253
-			],
254
-			63 => [
255
-				0 => 'filtre_application_dist',
256
-				1 => 'application/vnd.google-earth.kml+xml',
257
-			],
258
-			64 => [
259
-				0 => 'filtre_application_dist',
260
-				1 => 'application/vnd.google-earth.kmz',
261
-			],
262
-			65 => [
263
-				0 => 'filtre_text_dist',
264
-				1 => 'text/x-pascal',
265
-			],
266
-			66 => [
267
-				0 => 'filtre_application_dist',
268
-				1 => 'application/pdf',
269
-			],
270
-			67 => [
271
-				0 => 'filtre_application_dist',
272
-				1 => 'application/x-chess-pgn',
273
-			],
274
-			68 => [
275
-				0 => 'filtre_application_dist',
276
-				1 => 'application/vnd.ms-powerpoint',
277
-			],
278
-			70 => [
279
-				0 => 'filtre_image_dist',
280
-				1 => 'image/x-photoshop',
281
-			],
282
-			71 => [
283
-				0 => 'filtre_application_dist',
284
-				1 => 'application/x-redhat-package-manager',
285
-			],
286
-			72 => [
287
-				0 => 'filtre_application_dist',
288
-				1 => 'application/rtf',
289
-			],
290
-			73 => [
291
-				0 => 'filtre_application_dist',
292
-				1 => 'application/vnd.stardivision.impress',
293
-			],
294
-			74 => [
295
-				0 => 'filtre_application_dist',
296
-				1 => 'application/vnd.stardivision.writer',
297
-			],
298
-			75 => [
299
-				0 => 'filtre_application_dist',
300
-				1 => 'application/x-stuffit',
301
-			],
302
-			76 => [
303
-				0 => 'filtre_application_dist',
304
-				1 => 'application/vnd.sun.xml.calc',
305
-			],
306
-			77 => [
307
-				0 => 'filtre_application_dist',
308
-				1 => 'application/vnd.sun.xml.impress',
309
-			],
310
-			78 => [
311
-				0 => 'filtre_application_dist',
312
-				1 => 'application/vnd.sun.xml.writer',
313
-			],
314
-			79 => [
315
-				0 => 'filtre_text_dist',
316
-				1 => 'text/x-tex',
317
-			],
318
-			80 => [
319
-				0 => 'filtre_application_dist',
320
-				1 => 'application/x-gtar',
321
-			],
322
-			81 => [
323
-				0 => 'filtre_application_dist',
324
-				1 => 'application/x-bittorrent',
325
-			],
326
-			82 => [
327
-				0 => 'filtre_application_dist',
328
-				1 => 'application/x-font-ttf',
329
-			],
330
-			83 => [
331
-				0 => 'filtre_text_dist',
332
-				1 => 'text/plain',
333
-			],
334
-			84 => [
335
-				0 => 'filtre_application_dist',
336
-				1 => 'application/x-xcf',
337
-			],
338
-			85 => [
339
-				0 => 'filtre_application_dist',
340
-				1 => 'application/vnd.ms-excel',
341
-			],
342
-			86 => [
343
-				0 => 'filtre_application_dist',
344
-				1 => 'application/xspf+xml',
345
-			],
346
-			87 => [
347
-				0 => 'filtre_application_dist',
348
-				1 => 'application/xml',
349
-			],
350
-			88 => [
351
-				0 => 'filtre_application_dist',
352
-				1 => 'application/zip',
353
-			],
354
-			89 => [
355
-				0 => 'filtre_application_dist',
356
-				1 => 'application/vnd.oasis.opendocument.text',
357
-			],
358
-			90 => [
359
-				0 => 'filtre_application_dist',
360
-				1 => 'application/vnd.oasis.opendocument.spreadsheet',
361
-			],
362
-			91 => [
363
-				0 => 'filtre_application_dist',
364
-				1 => 'application/vnd.oasis.opendocument.presentation',
365
-			],
366
-			92 => [
367
-				0 => 'filtre_application_dist',
368
-				1 => 'application/vnd.oasis.opendocument.graphics',
369
-			],
370
-			93 => [
371
-				0 => 'filtre_application_dist',
372
-				1 => 'application/vnd.oasis.opendocument.chart',
373
-			],
374
-			94 => [
375
-				0 => 'filtre_application_dist',
376
-				1 => 'application/vnd.oasis.opendocument.formula',
377
-			],
378
-			95 => [
379
-				0 => 'filtre_application_dist',
380
-				1 => 'application/vnd.oasis.opendocument.database',
381
-			],
382
-			96 => [
383
-				0 => 'filtre_application_dist',
384
-				1 => 'application/vnd.oasis.opendocument.image',
385
-			],
386
-			97 => [
387
-				0 => 'filtre_application_dist',
388
-				1 => 'application/vnd.oasis.opendocument.text-master',
389
-			],
390
-			98 => [
391
-				0 => 'filtre_application_dist',
392
-				1 => 'application/vnd.oasis.opendocument.text-template',
393
-			],
394
-			99 => [
395
-				0 => 'filtre_application_dist',
396
-				1 => 'application/vnd.oasis.opendocument.spreadsheet-template',
397
-			],
398
-			100 => [
399
-				0 => 'filtre_application_dist',
400
-				1 => 'application/vnd.oasis.opendocument.presentation-template',
401
-			],
402
-			101 => [
403
-				0 => 'filtre_application_dist',
404
-				1 => 'application/vnd.oasis.opendocument.graphics-template',
405
-			],
406
-			104 => [
407
-				0 => 'filtre_application_dist',
408
-				1 => 'application/vnd.ms-word.document.macroEnabled.12',
409
-			],
410
-			105 => [
411
-				0 => 'filtre_application_dist',
412
-				1 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
413
-			],
414
-			106 => [
415
-				0 => 'filtre_application_dist',
416
-				1 => 'application/vnd.ms-word.template.macroEnabled.12',
417
-			],
418
-			107 => [
419
-				0 => 'filtre_application_dist',
420
-				1 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
421
-			],
422
-			108 => [
423
-				0 => 'filtre_application_dist',
424
-				1 => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
425
-			],
426
-			109 => [
427
-				0 => 'filtre_application_dist',
428
-				1 => 'application/vnd.openxmlformats-officedocument.presentationml.template',
429
-			],
430
-			110 => [
431
-				0 => 'filtre_application_dist',
432
-				1 => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
433
-			],
434
-			111 => [
435
-				0 => 'filtre_application_dist',
436
-				1 => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
437
-			],
438
-			112 => [
439
-				0 => 'filtre_application_dist',
440
-				1 => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
441
-			],
442
-			113 => [
443
-				0 => 'filtre_application_dist',
444
-				1 => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
445
-			],
446
-			114 => [
447
-				0 => 'filtre_application_dist',
448
-				1 => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
449
-			],
450
-			115 => [
451
-				0 => 'filtre_application_dist',
452
-				1 => 'application/vnd.ms-excel.addin.macroEnabled.12',
453
-			],
454
-			116 => [
455
-				0 => 'filtre_application_dist',
456
-				1 => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
457
-			],
458
-			117 => [
459
-				0 => 'filtre_application_dist',
460
-				1 => 'application/vnd.ms-excel.sheet.macroEnabled.12',
461
-			],
462
-			118 => [
463
-				0 => 'filtre_application_dist',
464
-				1 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
465
-			],
466
-			119 => [
467
-				0 => 'filtre_application_dist',
468
-				1 => 'application/vnd.ms-excel.template.macroEnabled.12',
469
-			],
470
-			120 => [
471
-				0 => 'filtre_application_dist',
472
-				1 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
473
-			],
474
-		];
475
-	}
26
+    public static function providerFiltresChercherFiltre(): array {
27
+        return [
28
+            0 => [
29
+                0 => 'filtre_identite_dist',
30
+                1 => 'identite',
31
+            ],
32
+            1 => [
33
+                0 => 'identite',
34
+                1 => 'zzhkezhkf',
35
+                2 => 'identite',
36
+            ],
37
+            3 => [
38
+                0 => 'identite',
39
+                1 => null,
40
+                2 => 'identite',
41
+            ],
42
+            4 => [
43
+                0 => 'filtre_text_dist',
44
+                1 => 'text',
45
+            ],
46
+            5 => [
47
+                0 => 'filtre_implode_dist',
48
+                1 => 'implode',
49
+            ],
50
+            6 => [
51
+                0 => 'filtre_image_dist',
52
+                1 => 'image/jpeg',
53
+            ],
54
+            7 => [
55
+                0 => 'filtre_image_dist',
56
+                1 => 'image/png',
57
+            ],
58
+            8 => [
59
+                0 => 'filtre_image_dist',
60
+                1 => 'image/gif',
61
+            ],
62
+            9 => [
63
+                0 => 'filtre_image_dist',
64
+                1 => 'image/x-ms-bmp',
65
+            ],
66
+            10 => [
67
+                0 => 'filtre_image_dist',
68
+                1 => 'image/tiff',
69
+            ],
70
+            11 => [
71
+                0 => 'filtre_audio_dist',
72
+                1 => 'audio/x-aiff',
73
+            ],
74
+            12 => [
75
+                0 => 'filtre_video_dist',
76
+                1 => 'video/x-ms-asf',
77
+            ],
78
+            13 => [
79
+                0 => 'filtre_video_dist',
80
+                1 => 'video/x-msvideo',
81
+            ],
82
+            14 => [
83
+                0 => 'filtre_application_dist',
84
+                1 => 'application/annodex',
85
+            ],
86
+            15 => [
87
+                0 => 'filtre_audio_dist',
88
+                1 => 'audio/annodex',
89
+            ],
90
+            16 => [
91
+                0 => 'filtre_video_dist',
92
+                1 => 'video/annodex',
93
+            ],
94
+            17 => [
95
+                0 => 'filtre_video_dist',
96
+                1 => 'video/x-dv',
97
+            ],
98
+            18 => [
99
+                0 => 'filtre_audio_dist',
100
+                1 => 'audio/x-flac',
101
+            ],
102
+            19 => [
103
+                0 => 'filtre_video_dist',
104
+                1 => 'video/x-flv',
105
+            ],
106
+            20 => [
107
+                0 => 'filtre_audio_dist',
108
+                1 => 'audio/mp4a-latm',
109
+            ],
110
+            23 => [
111
+                0 => 'filtre_video_dist',
112
+                1 => 'video/vnd.mpegurl',
113
+            ],
114
+            24 => [
115
+                0 => 'filtre_video_dist',
116
+                1 => 'video/x-m4v',
117
+            ],
118
+            25 => [
119
+                0 => 'filtre_audio_dist',
120
+                1 => 'audio/midi',
121
+            ],
122
+            26 => [
123
+                0 => 'filtre_audio_dist',
124
+                1 => 'audio/mka',
125
+            ],
126
+            27 => [
127
+                0 => 'filtre_video_dist',
128
+                1 => 'video/mkv',
129
+            ],
130
+            28 => [
131
+                0 => 'filtre_video_dist',
132
+                1 => 'video/x-mng',
133
+            ],
134
+            29 => [
135
+                0 => 'filtre_video_dist',
136
+                1 => 'video/quicktime',
137
+            ],
138
+            30 => [
139
+                0 => 'filtre_audio_dist',
140
+                1 => 'audio/mpeg',
141
+            ],
142
+            31 => [
143
+                0 => 'filtre_application_dist',
144
+                1 => 'application/mp4',
145
+            ],
146
+            32 => [
147
+                0 => 'filtre_video_dist',
148
+                1 => 'video/mpeg',
149
+            ],
150
+            33 => [
151
+                0 => 'filtre_audio_dist',
152
+                1 => 'audio/ogg',
153
+            ],
154
+            34 => [
155
+                0 => 'filtre_audio_dist',
156
+                1 => 'audio/ogg ',
157
+            ],
158
+            35 => [
159
+                0 => 'filtre_video_dist',
160
+                1 => 'video/ogg ',
161
+            ],
162
+            36 => [
163
+                0 => 'filtre_application_dist',
164
+                1 => 'application/ogg ',
165
+            ],
166
+            38 => [
167
+                0 => 'filtre_audio_x_pn_realaudio',
168
+                1 => 'audio/x-pn-realaudio',
169
+            ],
170
+            42 => [
171
+                0 => 'filtre_image_dist',
172
+                1 => 'image/svg+xml',
173
+            ],
174
+            43 => [
175
+                0 => 'filtre_application_dist',
176
+                1 => 'application/x-shockwave-flash',
177
+            ],
178
+            44 => [
179
+                0 => 'filtre_audio_dist',
180
+                1 => 'audio/x-wav',
181
+            ],
182
+            45 => [
183
+                0 => 'filtre_video_dist',
184
+                1 => 'video/x-ms-wmv',
185
+            ],
186
+            46 => [
187
+                0 => 'filtre_video_dist',
188
+                1 => 'video/3gpp',
189
+            ],
190
+            47 => [
191
+                0 => 'filtre_application_dist',
192
+                1 => 'application/illustrator',
193
+            ],
194
+            48 => [
195
+                0 => 'filtre_application_dist',
196
+                1 => 'application/abiword',
197
+            ],
198
+            49 => [
199
+                0 => 'filtre_application_dist',
200
+                1 => 'application/octet-stream',
201
+            ],
202
+            50 => [
203
+                0 => 'filtre_application_dist',
204
+                1 => 'application/x-blender',
205
+            ],
206
+            51 => [
207
+                0 => 'filtre_application_dist',
208
+                1 => 'application/x-bzip2',
209
+            ],
210
+            52 => [
211
+                0 => 'filtre_text_dist',
212
+                1 => 'text/x-csrc',
213
+            ],
214
+            53 => [
215
+                0 => 'filtre_text_dist',
216
+                1 => 'text/css',
217
+            ],
218
+            54 => [
219
+                0 => 'filtre_text_csv_dist',
220
+                1 => 'text/csv',
221
+            ],
222
+            55 => [
223
+                0 => 'filtre_application_dist',
224
+                1 => 'application/x-debian-package',
225
+            ],
226
+            56 => [
227
+                0 => 'filtre_application_dist',
228
+                1 => 'application/msword',
229
+            ],
230
+            57 => [
231
+                0 => 'filtre_image_dist',
232
+                1 => 'image/vnd.djvu',
233
+            ],
234
+            58 => [
235
+                0 => 'filtre_application_dist',
236
+                1 => 'application/x-dvi',
237
+            ],
238
+            59 => [
239
+                0 => 'filtre_application_dist',
240
+                1 => 'application/postscript',
241
+            ],
242
+            60 => [
243
+                0 => 'filtre_application_dist',
244
+                1 => 'application/x-gzip',
245
+            ],
246
+            61 => [
247
+                0 => 'filtre_text_dist',
248
+                1 => 'text/x-chdr',
249
+            ],
250
+            62 => [
251
+                0 => 'filtre_text_html_dist',
252
+                1 => 'text/html',
253
+            ],
254
+            63 => [
255
+                0 => 'filtre_application_dist',
256
+                1 => 'application/vnd.google-earth.kml+xml',
257
+            ],
258
+            64 => [
259
+                0 => 'filtre_application_dist',
260
+                1 => 'application/vnd.google-earth.kmz',
261
+            ],
262
+            65 => [
263
+                0 => 'filtre_text_dist',
264
+                1 => 'text/x-pascal',
265
+            ],
266
+            66 => [
267
+                0 => 'filtre_application_dist',
268
+                1 => 'application/pdf',
269
+            ],
270
+            67 => [
271
+                0 => 'filtre_application_dist',
272
+                1 => 'application/x-chess-pgn',
273
+            ],
274
+            68 => [
275
+                0 => 'filtre_application_dist',
276
+                1 => 'application/vnd.ms-powerpoint',
277
+            ],
278
+            70 => [
279
+                0 => 'filtre_image_dist',
280
+                1 => 'image/x-photoshop',
281
+            ],
282
+            71 => [
283
+                0 => 'filtre_application_dist',
284
+                1 => 'application/x-redhat-package-manager',
285
+            ],
286
+            72 => [
287
+                0 => 'filtre_application_dist',
288
+                1 => 'application/rtf',
289
+            ],
290
+            73 => [
291
+                0 => 'filtre_application_dist',
292
+                1 => 'application/vnd.stardivision.impress',
293
+            ],
294
+            74 => [
295
+                0 => 'filtre_application_dist',
296
+                1 => 'application/vnd.stardivision.writer',
297
+            ],
298
+            75 => [
299
+                0 => 'filtre_application_dist',
300
+                1 => 'application/x-stuffit',
301
+            ],
302
+            76 => [
303
+                0 => 'filtre_application_dist',
304
+                1 => 'application/vnd.sun.xml.calc',
305
+            ],
306
+            77 => [
307
+                0 => 'filtre_application_dist',
308
+                1 => 'application/vnd.sun.xml.impress',
309
+            ],
310
+            78 => [
311
+                0 => 'filtre_application_dist',
312
+                1 => 'application/vnd.sun.xml.writer',
313
+            ],
314
+            79 => [
315
+                0 => 'filtre_text_dist',
316
+                1 => 'text/x-tex',
317
+            ],
318
+            80 => [
319
+                0 => 'filtre_application_dist',
320
+                1 => 'application/x-gtar',
321
+            ],
322
+            81 => [
323
+                0 => 'filtre_application_dist',
324
+                1 => 'application/x-bittorrent',
325
+            ],
326
+            82 => [
327
+                0 => 'filtre_application_dist',
328
+                1 => 'application/x-font-ttf',
329
+            ],
330
+            83 => [
331
+                0 => 'filtre_text_dist',
332
+                1 => 'text/plain',
333
+            ],
334
+            84 => [
335
+                0 => 'filtre_application_dist',
336
+                1 => 'application/x-xcf',
337
+            ],
338
+            85 => [
339
+                0 => 'filtre_application_dist',
340
+                1 => 'application/vnd.ms-excel',
341
+            ],
342
+            86 => [
343
+                0 => 'filtre_application_dist',
344
+                1 => 'application/xspf+xml',
345
+            ],
346
+            87 => [
347
+                0 => 'filtre_application_dist',
348
+                1 => 'application/xml',
349
+            ],
350
+            88 => [
351
+                0 => 'filtre_application_dist',
352
+                1 => 'application/zip',
353
+            ],
354
+            89 => [
355
+                0 => 'filtre_application_dist',
356
+                1 => 'application/vnd.oasis.opendocument.text',
357
+            ],
358
+            90 => [
359
+                0 => 'filtre_application_dist',
360
+                1 => 'application/vnd.oasis.opendocument.spreadsheet',
361
+            ],
362
+            91 => [
363
+                0 => 'filtre_application_dist',
364
+                1 => 'application/vnd.oasis.opendocument.presentation',
365
+            ],
366
+            92 => [
367
+                0 => 'filtre_application_dist',
368
+                1 => 'application/vnd.oasis.opendocument.graphics',
369
+            ],
370
+            93 => [
371
+                0 => 'filtre_application_dist',
372
+                1 => 'application/vnd.oasis.opendocument.chart',
373
+            ],
374
+            94 => [
375
+                0 => 'filtre_application_dist',
376
+                1 => 'application/vnd.oasis.opendocument.formula',
377
+            ],
378
+            95 => [
379
+                0 => 'filtre_application_dist',
380
+                1 => 'application/vnd.oasis.opendocument.database',
381
+            ],
382
+            96 => [
383
+                0 => 'filtre_application_dist',
384
+                1 => 'application/vnd.oasis.opendocument.image',
385
+            ],
386
+            97 => [
387
+                0 => 'filtre_application_dist',
388
+                1 => 'application/vnd.oasis.opendocument.text-master',
389
+            ],
390
+            98 => [
391
+                0 => 'filtre_application_dist',
392
+                1 => 'application/vnd.oasis.opendocument.text-template',
393
+            ],
394
+            99 => [
395
+                0 => 'filtre_application_dist',
396
+                1 => 'application/vnd.oasis.opendocument.spreadsheet-template',
397
+            ],
398
+            100 => [
399
+                0 => 'filtre_application_dist',
400
+                1 => 'application/vnd.oasis.opendocument.presentation-template',
401
+            ],
402
+            101 => [
403
+                0 => 'filtre_application_dist',
404
+                1 => 'application/vnd.oasis.opendocument.graphics-template',
405
+            ],
406
+            104 => [
407
+                0 => 'filtre_application_dist',
408
+                1 => 'application/vnd.ms-word.document.macroEnabled.12',
409
+            ],
410
+            105 => [
411
+                0 => 'filtre_application_dist',
412
+                1 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
413
+            ],
414
+            106 => [
415
+                0 => 'filtre_application_dist',
416
+                1 => 'application/vnd.ms-word.template.macroEnabled.12',
417
+            ],
418
+            107 => [
419
+                0 => 'filtre_application_dist',
420
+                1 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
421
+            ],
422
+            108 => [
423
+                0 => 'filtre_application_dist',
424
+                1 => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
425
+            ],
426
+            109 => [
427
+                0 => 'filtre_application_dist',
428
+                1 => 'application/vnd.openxmlformats-officedocument.presentationml.template',
429
+            ],
430
+            110 => [
431
+                0 => 'filtre_application_dist',
432
+                1 => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
433
+            ],
434
+            111 => [
435
+                0 => 'filtre_application_dist',
436
+                1 => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
437
+            ],
438
+            112 => [
439
+                0 => 'filtre_application_dist',
440
+                1 => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
441
+            ],
442
+            113 => [
443
+                0 => 'filtre_application_dist',
444
+                1 => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
445
+            ],
446
+            114 => [
447
+                0 => 'filtre_application_dist',
448
+                1 => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
449
+            ],
450
+            115 => [
451
+                0 => 'filtre_application_dist',
452
+                1 => 'application/vnd.ms-excel.addin.macroEnabled.12',
453
+            ],
454
+            116 => [
455
+                0 => 'filtre_application_dist',
456
+                1 => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
457
+            ],
458
+            117 => [
459
+                0 => 'filtre_application_dist',
460
+                1 => 'application/vnd.ms-excel.sheet.macroEnabled.12',
461
+            ],
462
+            118 => [
463
+                0 => 'filtre_application_dist',
464
+                1 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
465
+            ],
466
+            119 => [
467
+                0 => 'filtre_application_dist',
468
+                1 => 'application/vnd.ms-excel.template.macroEnabled.12',
469
+            ],
470
+            120 => [
471
+                0 => 'filtre_application_dist',
472
+                1 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
473
+            ],
474
+        ];
475
+    }
476 476
 }
Please login to merge, or discard this patch.
ecrire/tests/Filtre/ExtraireBalisesTest.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -13,150 +13,150 @@
 block discarded – undo
13 13
 
14 14
 class ExtraireBalisesTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('./inc/filtres.php', '', true);
18
-		find_in_path('./inc/lang.php', '', true);
19
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('./inc/filtres.php', '', true);
18
+        find_in_path('./inc/lang.php', '', true);
19
+    }
20 20
 
21
-	#[DataProvider('providerFiltresExtraireBalises')]
22
-	public function testFiltresExtraireBalises($expected, ...$args): void {
23
-		$actual = extraire_balises(...$args);
24
-		$this->assertSame($expected, $actual);
25
-	}
21
+    #[DataProvider('providerFiltresExtraireBalises')]
22
+    public function testFiltresExtraireBalises($expected, ...$args): void {
23
+        $actual = extraire_balises(...$args);
24
+        $this->assertSame($expected, $actual);
25
+    }
26 26
 
27
-	#[DataProvider('providerFiltresExtraireBalises')]
28
-	public function testFiltresExtraireBalise($expected, ...$args): void {
29
-		// extraire_balise doit renvoyer le premier résultat de extraire_balises
30
-		// sauf si on fournit un tableau de chaine en entree, ce doit être alors le premier résultat de chaque sous-tableau
31
-		if (count($args) === 3) {
32
-			$options = array_pop($args);
33
-			$profondeur = ($options['profondeur'] ?? 1);
34
-			$args[] = $profondeur;
35
-		}
36
-		$first_result = reset($expected);
37
-		if (is_array($first_result)) {
38
-			$first_result = [];
39
-			foreach ($expected as $e) {
40
-				$first_result[] = (empty($e) ? '' : reset($e));
41
-			}
42
-			$expected = $first_result;
43
-		} else {
44
-			$expected = (empty($expected) ? '' : $first_result);
45
-		}
46
-		$actual = extraire_balise(...$args);
47
-		$this->assertSame($expected, $actual);
48
-	}
27
+    #[DataProvider('providerFiltresExtraireBalises')]
28
+    public function testFiltresExtraireBalise($expected, ...$args): void {
29
+        // extraire_balise doit renvoyer le premier résultat de extraire_balises
30
+        // sauf si on fournit un tableau de chaine en entree, ce doit être alors le premier résultat de chaque sous-tableau
31
+        if (count($args) === 3) {
32
+            $options = array_pop($args);
33
+            $profondeur = ($options['profondeur'] ?? 1);
34
+            $args[] = $profondeur;
35
+        }
36
+        $first_result = reset($expected);
37
+        if (is_array($first_result)) {
38
+            $first_result = [];
39
+            foreach ($expected as $e) {
40
+                $first_result[] = (empty($e) ? '' : reset($e));
41
+            }
42
+            $expected = $first_result;
43
+        } else {
44
+            $expected = (empty($expected) ? '' : $first_result);
45
+        }
46
+        $actual = extraire_balise(...$args);
47
+        $this->assertSame($expected, $actual);
48
+    }
49 49
 
50
-	public function testFiltresExtraireBalisesMediaRss(): void {
51
-		$rss = file_get_contents(dirname(__DIR__) . '/Fixtures/data/dailymotion.rss');
52
-		if (empty($rss)) {
53
-			$this->markTestSkipped();
54
-		}
50
+    public function testFiltresExtraireBalisesMediaRss(): void {
51
+        $rss = file_get_contents(dirname(__DIR__) . '/Fixtures/data/dailymotion.rss');
52
+        if (empty($rss)) {
53
+            $this->markTestSkipped();
54
+        }
55 55
 
56
-		$balises_media = extraire_balises($rss, 'media:content');
57
-		$this->assertIsArray($balises_media);
58
-		$this->assertEquals(count($balises_media), 40);
59
-	}
56
+        $balises_media = extraire_balises($rss, 'media:content');
57
+        $this->assertIsArray($balises_media);
58
+        $this->assertEquals(count($balises_media), 40);
59
+    }
60 60
 
61
-	public static function providerFiltresExtraireBalises(): array {
62
-		return [
63
-			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>'],
64
-			[['<a href="truc" />'], 'allo <a href="truc" />'],
65
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />"],
66
-			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">']],
67
-			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin'],
68
-			[
69
-				['<a href="truc">chose</a>', '<A href="truc">machin</a>'],
70
-				'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>',
71
-			],
72
-			[['<a href="truc">'], 'bonjour <a href="truc">chose'],
73
-			[['<a href="truc"/>'], '<a href="truc"/>chose</a>'],
74
-			[['<a>chose</a>'], '<a>chose</a>'],
75
-			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>', 'a'],
76
-			[['<a href="truc" />'], 'allo <a href="truc" />', 'a'],
77
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />", 'a'],
78
-			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">'], 'a'],
79
-			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin', 'a'],
80
-			[
81
-				['<a href="truc">chose</a>', '<A href="truc">machin</a>'],
82
-				'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>',
83
-				'a',
84
-			],
85
-			[['<a href="truc">'], 'bonjour <a href="truc">chose', 'a'],
86
-			[['<a href="truc"/>'], '<a href="truc"/>chose</a>', 'a'],
87
-			[['<a>chose</a>'], '<a>chose</a>', 'a'],
88
-			[[], 'allo <a href="truc">chose</a>', 'b'],
89
-			[[], 'allo <a href="truc" />', 'b'],
90
-			[[], 'allo' . "\n" . " <a\nhref='truc' />", 'b'],
91
-			[[[], []], ['allo <a href="1">', 'allo <a href="2">'], 'b'],
92
-			[[], 'bonjour <a href="truc">chose</a> machin', 'b'],
93
-			[[], 'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>', 'b'],
94
-			[[], 'bonjour <a href="truc">chose', 'b'],
95
-			[[], '<a href="truc"/>chose</a>', 'b'],
96
-			[[], '<a>chose</a>', 'b'],
97
-			'div_2' => [
98
-				['<div class="message">Hello <div class="inside">World!</div></div>'],
99
-				'<div class="message">Hello <div class="inside">World!</div></div>',
100
-				'div',
101
-			],
102
-			'div_3' => [
103
-				['<div class="message">Hello <div class="inside">World<div>!</div></div></div>'],
104
-				'<div class="message">Hello <div class="inside">World<div>!</div></div></div>',
105
-				'div',
106
-			],
107
-			'div_3_et_autofermante_1' => [
108
-				['<div class="message">Hello <div class="inside">World<div>! <div/> </div></div></div>'],
109
-				'<div class="message">Hello <div class="inside">World<div>! <div/> </div></div></div>',
110
-				'div',
111
-			],
112
-			'div_3_et_autofermante_2' => [
113
-				['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div></div>'],
114
-				'<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div></div>',
115
-				'div',
116
-			],
117
-			'div_3_et_autofermante_3' => [
118
-				['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>'],
119
-				'<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>',
120
-				'div',
121
-			],
122
-			'div_3_et_autofermante_4' => [
123
-				['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>', '<div/>'],
124
-				'<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
125
-				'div',
126
-			],
127
-			'div_3_et_autofermante_5' => [
128
-				[
129
-					'<div/>',
130
-					'<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>',
131
-					'<div/>',
132
-				],
133
-				'<div/><div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
134
-				'div',
135
-			],
136
-			'div_3_et_autofermante_5_nbmax' => [
137
-				['<div/>'],
138
-				'<div/><div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
139
-				'div',
140
-				['nb_max' => 1],
141
-			],
142
-			'div_3_et_autofermante_5_profondeur_2' => [
143
-				['<div class="hello">Hello</div>', '<div class="world">World</div>', '<div>!</div>', '<div/>'],
144
-				'<div class="message"><div class="hello">Hello</div> <div class="world">World</div><div>!</div> <div/></div>',
145
-				'div',
146
-				['profondeur' => '2'],
147
-			],
148
-			'div_3_et_autofermante_5_profondeur_3' => [
149
-				[],
150
-				'<div class="message"><div class="hello">Hello</div> <div class="world">World</div><div>!</div> <div/></div>',
151
-				'div',
152
-				['profondeur' => '3'],
153
-			],
154
-			'div_3_et_autofermante_5_profondeur_3_2' => [
155
-				['<div>lo</div>'],
156
-				'<div class="message"><div class="hello">Hel<div>lo</div></div> <div class="world">World</div><div>!</div> <div/></div>',
157
-				'div',
158
-				['profondeur' => '3'],
159
-			],
160
-		];
161
-	}
61
+    public static function providerFiltresExtraireBalises(): array {
62
+        return [
63
+            [['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>'],
64
+            [['<a href="truc" />'], 'allo <a href="truc" />'],
65
+            [["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />"],
66
+            [[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">']],
67
+            [['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin'],
68
+            [
69
+                ['<a href="truc">chose</a>', '<A href="truc">machin</a>'],
70
+                'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>',
71
+            ],
72
+            [['<a href="truc">'], 'bonjour <a href="truc">chose'],
73
+            [['<a href="truc"/>'], '<a href="truc"/>chose</a>'],
74
+            [['<a>chose</a>'], '<a>chose</a>'],
75
+            [['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>', 'a'],
76
+            [['<a href="truc" />'], 'allo <a href="truc" />', 'a'],
77
+            [["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />", 'a'],
78
+            [[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">'], 'a'],
79
+            [['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin', 'a'],
80
+            [
81
+                ['<a href="truc">chose</a>', '<A href="truc">machin</a>'],
82
+                'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>',
83
+                'a',
84
+            ],
85
+            [['<a href="truc">'], 'bonjour <a href="truc">chose', 'a'],
86
+            [['<a href="truc"/>'], '<a href="truc"/>chose</a>', 'a'],
87
+            [['<a>chose</a>'], '<a>chose</a>', 'a'],
88
+            [[], 'allo <a href="truc">chose</a>', 'b'],
89
+            [[], 'allo <a href="truc" />', 'b'],
90
+            [[], 'allo' . "\n" . " <a\nhref='truc' />", 'b'],
91
+            [[[], []], ['allo <a href="1">', 'allo <a href="2">'], 'b'],
92
+            [[], 'bonjour <a href="truc">chose</a> machin', 'b'],
93
+            [[], 'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>', 'b'],
94
+            [[], 'bonjour <a href="truc">chose', 'b'],
95
+            [[], '<a href="truc"/>chose</a>', 'b'],
96
+            [[], '<a>chose</a>', 'b'],
97
+            'div_2' => [
98
+                ['<div class="message">Hello <div class="inside">World!</div></div>'],
99
+                '<div class="message">Hello <div class="inside">World!</div></div>',
100
+                'div',
101
+            ],
102
+            'div_3' => [
103
+                ['<div class="message">Hello <div class="inside">World<div>!</div></div></div>'],
104
+                '<div class="message">Hello <div class="inside">World<div>!</div></div></div>',
105
+                'div',
106
+            ],
107
+            'div_3_et_autofermante_1' => [
108
+                ['<div class="message">Hello <div class="inside">World<div>! <div/> </div></div></div>'],
109
+                '<div class="message">Hello <div class="inside">World<div>! <div/> </div></div></div>',
110
+                'div',
111
+            ],
112
+            'div_3_et_autofermante_2' => [
113
+                ['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div></div>'],
114
+                '<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div></div>',
115
+                'div',
116
+            ],
117
+            'div_3_et_autofermante_3' => [
118
+                ['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>'],
119
+                '<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>',
120
+                'div',
121
+            ],
122
+            'div_3_et_autofermante_4' => [
123
+                ['<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>', '<div/>'],
124
+                '<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
125
+                'div',
126
+            ],
127
+            'div_3_et_autofermante_5' => [
128
+                [
129
+                    '<div/>',
130
+                    '<div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div>',
131
+                    '<div/>',
132
+                ],
133
+                '<div/><div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
134
+                'div',
135
+            ],
136
+            'div_3_et_autofermante_5_nbmax' => [
137
+                ['<div/>'],
138
+                '<div/><div class="message">Hello <div class="inside">World<div>!<div/></div><div/></div><div/></div><div/>',
139
+                'div',
140
+                ['nb_max' => 1],
141
+            ],
142
+            'div_3_et_autofermante_5_profondeur_2' => [
143
+                ['<div class="hello">Hello</div>', '<div class="world">World</div>', '<div>!</div>', '<div/>'],
144
+                '<div class="message"><div class="hello">Hello</div> <div class="world">World</div><div>!</div> <div/></div>',
145
+                'div',
146
+                ['profondeur' => '2'],
147
+            ],
148
+            'div_3_et_autofermante_5_profondeur_3' => [
149
+                [],
150
+                '<div class="message"><div class="hello">Hello</div> <div class="world">World</div><div>!</div> <div/></div>',
151
+                'div',
152
+                ['profondeur' => '3'],
153
+            ],
154
+            'div_3_et_autofermante_5_profondeur_3_2' => [
155
+                ['<div>lo</div>'],
156
+                '<div class="message"><div class="hello">Hel<div>lo</div></div> <div class="world">World</div><div>!</div> <div/></div>',
157
+                'div',
158
+                ['profondeur' => '3'],
159
+            ],
160
+        ];
161
+    }
162 162
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function testFiltresExtraireBalisesMediaRss(): void {
51
-		$rss = file_get_contents(dirname(__DIR__) . '/Fixtures/data/dailymotion.rss');
51
+		$rss = file_get_contents(dirname(__DIR__).'/Fixtures/data/dailymotion.rss');
52 52
 		if (empty($rss)) {
53 53
 			$this->markTestSkipped();
54 54
 		}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		return [
63 63
 			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>'],
64 64
 			[['<a href="truc" />'], 'allo <a href="truc" />'],
65
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />"],
65
+			[["<a\nhref='truc' />"], 'allo'."\n"." <a\nhref='truc' />"],
66 66
 			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">']],
67 67
 			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin'],
68 68
 			[
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			[['<a>chose</a>'], '<a>chose</a>'],
75 75
 			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>', 'a'],
76 76
 			[['<a href="truc" />'], 'allo <a href="truc" />', 'a'],
77
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />", 'a'],
77
+			[["<a\nhref='truc' />"], 'allo'."\n"." <a\nhref='truc' />", 'a'],
78 78
 			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">'], 'a'],
79 79
 			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin', 'a'],
80 80
 			[
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			[['<a>chose</a>'], '<a>chose</a>', 'a'],
88 88
 			[[], 'allo <a href="truc">chose</a>', 'b'],
89 89
 			[[], 'allo <a href="truc" />', 'b'],
90
-			[[], 'allo' . "\n" . " <a\nhref='truc' />", 'b'],
90
+			[[], 'allo'."\n"." <a\nhref='truc' />", 'b'],
91 91
 			[[[], []], ['allo <a href="1">', 'allo <a href="2">'], 'b'],
92 92
 			[[], 'bonjour <a href="truc">chose</a> machin', 'b'],
93 93
 			[[], 'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>', 'b'],
Please login to merge, or discard this patch.