Skip to content

Commit b58efe8

Browse files
committed
Fix named arguments in data providers
1 parent 9de29a7 commit b58efe8

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

Tests/TextSanitizer/UrlSanitizerTest.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testSanitize(?string $input, ?array $allowedSchemes, ?array $all
2424
$this->assertSame($expected, UrlSanitizer::sanitize($input, $allowedSchemes, $forceHttps, $allowedHosts, $allowRelative));
2525
}
2626

27-
public static function provideSanitize()
27+
public static function provideSanitize(): iterable
2828
{
2929
// Simple accepted cases
3030
yield [
@@ -33,7 +33,7 @@ public static function provideSanitize()
3333
'allowedHosts' => null,
3434
'forceHttps' => false,
3535
'allowRelative' => false,
36-
'output' => null,
36+
'expected' => null,
3737
];
3838

3939
yield [
@@ -42,7 +42,7 @@ public static function provideSanitize()
4242
'allowedHosts' => null,
4343
'forceHttps' => false,
4444
'allowRelative' => false,
45-
'output' => null,
45+
'expected' => null,
4646
];
4747

4848
yield [
@@ -51,7 +51,7 @@ public static function provideSanitize()
5151
'allowedHosts' => null,
5252
'forceHttps' => false,
5353
'allowRelative' => false,
54-
'output' => 'http://trusted.com/link.php',
54+
'expected' => 'http://trusted.com/link.php',
5555
];
5656

5757
yield [
@@ -60,7 +60,7 @@ public static function provideSanitize()
6060
'allowedHosts' => null,
6161
'forceHttps' => false,
6262
'allowRelative' => false,
63-
'output' => 'https://trusted.com/link.php',
63+
'expected' => 'https://trusted.com/link.php',
6464
];
6565

6666
yield [
@@ -69,7 +69,7 @@ public static function provideSanitize()
6969
'allowedHosts' => null,
7070
'forceHttps' => false,
7171
'allowRelative' => false,
72-
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
72+
'expected' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
7373
];
7474

7575
yield [
@@ -78,7 +78,7 @@ public static function provideSanitize()
7878
'allowedHosts' => null,
7979
'forceHttps' => false,
8080
'allowRelative' => false,
81-
'output' => 'https://trusted.com/link.php',
81+
'expected' => 'https://trusted.com/link.php',
8282
];
8383

8484
yield [
@@ -87,7 +87,7 @@ public static function provideSanitize()
8787
'allowedHosts' => ['trusted.com'],
8888
'forceHttps' => false,
8989
'allowRelative' => false,
90-
'output' => 'https://trusted.com/link.php',
90+
'expected' => 'https://trusted.com/link.php',
9191
];
9292

9393
yield [
@@ -96,7 +96,7 @@ public static function provideSanitize()
9696
'allowedHosts' => ['trusted.com'],
9797
'forceHttps' => false,
9898
'allowRelative' => false,
99-
'output' => 'http://trusted.com/link.php',
99+
'expected' => 'http://trusted.com/link.php',
100100
];
101101

102102
yield [
@@ -105,7 +105,7 @@ public static function provideSanitize()
105105
'allowedHosts' => null,
106106
'forceHttps' => false,
107107
'allowRelative' => false,
108-
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
108+
'expected' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
109109
];
110110

111111
// Simple filtered cases
@@ -115,7 +115,7 @@ public static function provideSanitize()
115115
'allowedHosts' => null,
116116
'forceHttps' => false,
117117
'allowRelative' => false,
118-
'output' => null,
118+
'expected' => null,
119119
];
120120

121121
yield [
@@ -124,7 +124,7 @@ public static function provideSanitize()
124124
'allowedHosts' => null,
125125
'forceHttps' => false,
126126
'allowRelative' => false,
127-
'output' => null,
127+
'expected' => null,
128128
];
129129

130130
yield [
@@ -133,7 +133,7 @@ public static function provideSanitize()
133133
'allowedHosts' => null,
134134
'forceHttps' => false,
135135
'allowRelative' => true,
136-
'output' => 'http:link.php',
136+
'expected' => 'http:link.php',
137137
];
138138

139139
yield [
@@ -142,7 +142,7 @@ public static function provideSanitize()
142142
'allowedHosts' => ['trusted.com'],
143143
'forceHttps' => false,
144144
'allowRelative' => false,
145-
'output' => null,
145+
'expected' => null,
146146
];
147147

148148
yield [
@@ -151,7 +151,7 @@ public static function provideSanitize()
151151
'allowedHosts' => null,
152152
'forceHttps' => false,
153153
'allowRelative' => false,
154-
'output' => null,
154+
'expected' => null,
155155
];
156156

157157
yield [
@@ -160,7 +160,7 @@ public static function provideSanitize()
160160
'allowedHosts' => ['trusted.com'],
161161
'forceHttps' => false,
162162
'allowRelative' => false,
163-
'output' => null,
163+
'expected' => null,
164164
];
165165

166166
yield [
@@ -169,7 +169,7 @@ public static function provideSanitize()
169169
'allowedHosts' => ['trusted.com'],
170170
'forceHttps' => false,
171171
'allowRelative' => false,
172-
'output' => null,
172+
'expected' => null,
173173
];
174174

175175
yield [
@@ -178,7 +178,7 @@ public static function provideSanitize()
178178
'allowedHosts' => null,
179179
'forceHttps' => false,
180180
'allowRelative' => false,
181-
'output' => null,
181+
'expected' => null,
182182
];
183183

184184
yield [
@@ -187,7 +187,7 @@ public static function provideSanitize()
187187
'allowedHosts' => ['trusted.com'],
188188
'forceHttps' => false,
189189
'allowRelative' => false,
190-
'output' => null,
190+
'expected' => null,
191191
];
192192

193193
// Allow null host (data scheme for instance)
@@ -197,7 +197,7 @@ public static function provideSanitize()
197197
'allowedHosts' => ['trusted.com', null],
198198
'forceHttps' => false,
199199
'allowRelative' => false,
200-
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
200+
'expected' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
201201
];
202202

203203
// Force HTTPS
@@ -207,7 +207,7 @@ public static function provideSanitize()
207207
'allowedHosts' => ['trusted.com'],
208208
'forceHttps' => true,
209209
'allowRelative' => false,
210-
'output' => 'https://trusted.com/link.php',
210+
'expected' => 'https://trusted.com/link.php',
211211
];
212212

213213
yield [
@@ -216,7 +216,7 @@ public static function provideSanitize()
216216
'allowedHosts' => ['trusted.com'],
217217
'forceHttps' => true,
218218
'allowRelative' => false,
219-
'output' => 'https://trusted.com/link.php',
219+
'expected' => 'https://trusted.com/link.php',
220220
];
221221

222222
yield [
@@ -225,7 +225,7 @@ public static function provideSanitize()
225225
'allowedHosts' => null,
226226
'forceHttps' => true,
227227
'allowRelative' => false,
228-
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
228+
'expected' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
229229
];
230230

231231
yield [
@@ -234,7 +234,7 @@ public static function provideSanitize()
234234
'allowedHosts' => ['trusted.com', null],
235235
'forceHttps' => true,
236236
'allowRelative' => false,
237-
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
237+
'expected' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
238238
];
239239

240240
// Domain matching
@@ -244,7 +244,7 @@ public static function provideSanitize()
244244
'allowedHosts' => ['trusted.com'],
245245
'forceHttps' => false,
246246
'allowRelative' => false,
247-
'output' => 'https://subdomain.trusted.com/link.php',
247+
'expected' => 'https://subdomain.trusted.com/link.php',
248248
];
249249

250250
yield [
@@ -253,7 +253,7 @@ public static function provideSanitize()
253253
'allowedHosts' => ['trusted.com'],
254254
'forceHttps' => false,
255255
'allowRelative' => false,
256-
'output' => null,
256+
'expected' => null,
257257
];
258258

259259
yield [
@@ -262,7 +262,7 @@ public static function provideSanitize()
262262
'allowedHosts' => ['trusted.com'],
263263
'forceHttps' => false,
264264
'allowRelative' => false,
265-
'output' => 'https://deep.subdomain.trusted.com/link.php',
265+
'expected' => 'https://deep.subdomain.trusted.com/link.php',
266266
];
267267

268268
yield [
@@ -271,7 +271,7 @@ public static function provideSanitize()
271271
'allowedHosts' => ['trusted.com'],
272272
'forceHttps' => false,
273273
'allowRelative' => false,
274-
'output' => null,
274+
'expected' => null,
275275
];
276276

277277
// Allow relative
@@ -281,7 +281,7 @@ public static function provideSanitize()
281281
'allowedHosts' => ['trusted.com'],
282282
'forceHttps' => true,
283283
'allowRelative' => true,
284-
'output' => '/link.php',
284+
'expected' => '/link.php',
285285
];
286286

287287
yield [
@@ -290,7 +290,7 @@ public static function provideSanitize()
290290
'allowedHosts' => ['trusted.com'],
291291
'forceHttps' => true,
292292
'allowRelative' => false,
293-
'output' => null,
293+
'expected' => null,
294294
];
295295
}
296296

0 commit comments

Comments
 (0)