ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
URITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once("vendor/composer/vendor/autoload.php");
22
23use ILIAS\Data;
24use PHPUnit\Framework\TestCase;
25
26class URITest extends TestCase
27{
28 private const URI_COMPLETE = 'g+it://github.com:8080/someaccount/somerepo/somerepo.git?query_par_1=val_1&query_par_2=val_2#fragment';
29
30 private const URI_COMPLETE_IPV4 = 'g+it://10.0.0.86:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
31
32 private const URI_COMPLETE_LOCALHOST = 'g+it://localhost:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
33
34
35 private const URI_NO_PATH_1 = 'g-it://ilias%2Da.de:8080?query_par_1=val_1&query_par_2=val_2#fragment';
36 private const URI_NO_PATH_2 = 'g.it://amaz;on.co.uk:8080/?query_par_1=val_1&query_par_2=val_2#fragment';
37
38 private const URI_NO_QUERY_1 = 'git://one-letter-top-level.a:8080/someaccount/somerepo/somerepo.git/#fragment';
39 private const URI_NO_QUERY_2 = 'git://github.com:8080/someaccount/somerepo/somerepo.git#fragment';
40
41 private const URI_AUTHORITY_AND_QUERY_1 = 'git://github.com?query_p$,;A!\'*+()ar_1=val_1&quer?y_par_2=val_2';
42 private const URI_AUTHORITY_AND_QUERY_2 = 'git://github.com/?qu/ery_p$,;A!\'*+()ar_1=val_1&quer?y_par_2=val_2';
43
44 private const URI_AUTHORITY_AND_FRAGMENT = 'git://github.com:8080/#fragment$,;A!\'*+()ar_1=val_1&';
45
46 private const URI_AUTHORITY_PATH_FRAGMENT = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git#fragA!\'*+()arment';
47
48 private const URI_PATH = 'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/';
49
50 private const URI_AUTHORITY_ONLY = 'git://git$,;hub.com';
51
52 private const URI_NO_SCHEMA = 'git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/';
53
54 private const URI_NO_AUTHORITY = 'git://:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
55
56 private const URI_WRONG_SCHEMA = 'gi$t://git$,;hub.com';
57
58 private const URI_WRONG_AUTHORITY_1 = 'git://git$,;hu<b.com:8080/someacc$,;ount/somerepo/somerepo.git/';
59 private const URI_WRONG_AUTHORITY_2 = 'git://git$,;hu=b.com/someacc$,;ount/somerepo/somerepo.git/';
60
61 private const URI_INVALID = 'https://host.de/ilias.php/"><script>alert(1)</script>?baseClass=ilObjChatroomGUI&cmd=getOSDNotifications&cmdMode=asynch&max_age=15192913';
62
63 private const URI_INVALID_CHARACTERS_IN_QUERY = 'git://github.com?query_p=:&query_p2=ilias@ilias.de';
64
65 private const URI_FAKEPCENC = 'g+it://github.com:8080/someaccoun%t/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
66
67 private const URI_REALPCTENC = 'g+it://github.com:8080/someaccount%2Fsomerepo/som%2brepo.git/?par_lower=val_%2b&par_upper=val_%C3%A1#fragment';
68 private const PATH_REALPCTENC = 'someaccount%2Fsomerepo/som%2brepo.git';
69 private const PARAMS_REALPCTENC = [
70 'par_lower' => 'val_+',
71 'par_upper' => 'val_รก'
72 ];
73
74 private const URI_HOST_ALPHADIG_START_1 = 'g+it://-github.com:8080/someaccount';
75 private const URI_HOST_ALPHADIG_START_2 = 'g+it://github-.com:8080/someaccount';
76 private const URI_HOST_ALPHADIG_START_3 = 'http://.';
77 private const URI_HOST_ALPHADIG_START_4 = 'http://../';
78 private const URI_HOST_ALPHADIG_START_5 = 'http://-error-.invalid/';
79
80 private const URI_BASE = 'git://github.com:8080/someaccount/somerepo/somerepo.git';
81 private const PARAMS = [
82 'par_1' => 'val_1',
83 'par_2' => 'val_2'
84 ];
85
86
87 #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
88 public function test_init(): \ILIAS\Data\URI
89 {
90 return new ILIAS\Data\URI(self::URI_COMPLETE);
91 }
92
93 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
94 public function test_ipv4(): void
95 {
96 $uri = new ILIAS\Data\URI(self::URI_COMPLETE_IPV4);
97 $this->assertEquals('g+it', $uri->getSchema());
98 $this->assertEquals('10.0.0.86:8080', $uri->getAuthority());
99 $this->assertEquals('10.0.0.86', $uri->getHost());
100 $this->assertEquals(8080, $uri->getPort());
101 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
102 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
103 $this->assertEquals('fragment', $uri->getFragment());
104 }
105
106 #[\PHPUnit\Framework\Attributes\DataProvider('provideIPv6addresses')]
107 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
108 public function testIPv6(string $host): void
109 {
110 $uri = new ILIAS\Data\URI('http://' . $host);
111 $this->assertEquals('http', $uri->getSchema());
112 $this->assertEquals($host, $uri->getAuthority());
113 $this->assertEquals($host, $uri->getHost());
114 $this->assertEquals(null, $uri->getPort());
115 $this->assertEquals(null, $uri->getPath());
116 $this->assertEquals(null, $uri->getQuery());
117 $this->assertEquals(null, $uri->getFragment());
118 }
119
120 public static function provideIPv6addresses(): array
121 {
122 return [
123 // Long form.
124 ['[1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0]'],
125 ['[1:2:3:4:5:6:7:8]'],
126 // Short form.
127 ['[::1]'],
128 ['[::]'],
129 ['[::Ff00]'],
130 ['[1::]'],
131 ['[::3:4:5:6:7:8]'],
132 ['[3:4:5:6:7:8::]'],
133 ['[12::34]'],
134 // Embedded IPv4 (long).
135 ['[1234:5678:9ABC:DEF0:1234:5678:123.123.123.123]'],
136 // Embedded IPv4 (short).
137 ['[::123.123.123.123]'],
138 ['[1::123.123.123.123]'],
139 ['[1:3:4::123.123.123.123]'],
140 ['[::f:a:123.123.123.123]'],
141 ];
142 }
143
144 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
145 public function test_localhost(): void
146 {
147 $uri = new ILIAS\Data\URI(self::URI_COMPLETE_LOCALHOST);
148 $this->assertEquals('g+it', $uri->getSchema());
149 $this->assertEquals('localhost:8080', $uri->getAuthority());
150 $this->assertEquals('localhost', $uri->getHost());
151 $this->assertEquals(8080, $uri->getPort());
152 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
153 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
154 $this->assertEquals('fragment', $uri->getFragment());
155 }
156
157
158 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
159 public function test_components($uri): void
160 {
161 $this->assertEquals('g+it', $uri->getSchema());
162 $this->assertEquals('github.com:8080', $uri->getAuthority());
163 $this->assertEquals('github.com', $uri->getHost());
164 $this->assertEquals('8080', $uri->getPort());
165 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
166 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
167 $this->assertEquals('fragment', $uri->getFragment());
168 }
169
170 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
171 public function test_base_uri($uri): void
172 {
173 $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $uri->getBaseURI());
174 }
175
176 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
177 public function test_base_uri_idempotent($uri): void
178 {
179 $base_uri = $uri->getBaseURI();
180 $this->assertEquals('g+it://github.com:8080/someaccount/somerepo/somerepo.git', $base_uri);
181 $this->assertEquals('g+it', $uri->getSchema());
182 $this->assertEquals('github.com:8080', $uri->getAuthority());
183 $this->assertEquals('github.com', $uri->getHost());
184 $this->assertEquals('8080', $uri->getPort());
185 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
186 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
187 $this->assertEquals('fragment', $uri->getFragment());
188
189 $uri = new ILIAS\Data\URI($base_uri);
190 $this->assertEquals($base_uri, $uri->getBaseURI());
191 $this->assertEquals('g+it', $uri->getSchema());
192 $this->assertEquals('github.com:8080', $uri->getAuthority());
193 $this->assertEquals('github.com', $uri->getHost());
194 $this->assertEquals('8080', $uri->getPort());
195 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
196 $this->assertNull($uri->getQuery());
197 $this->assertNull($uri->getFragment());
198 }
199
200
201 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
202 public function test_no_path(): void
203 {
204 $uri = new ILIAS\Data\URI(self::URI_NO_PATH_1);
205 $this->assertEquals('g-it', $uri->getSchema());
206 $this->assertEquals('ilias%2Da.de:8080', $uri->getAuthority());
207 $this->assertEquals('ilias%2Da.de', $uri->getHost());
208 $this->assertEquals('8080', $uri->getPort());
209 $this->assertNull($uri->getPath());
210 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
211 $this->assertEquals('fragment', $uri->getFragment());
212
213 $uri = new ILIAS\Data\URI(self::URI_NO_PATH_2);
214 $this->assertEquals('g.it', $uri->getSchema());
215 $this->assertEquals('amaz;on.co.uk:8080', $uri->getAuthority());
216 $this->assertEquals('amaz;on.co.uk', $uri->getHost());
217 $this->assertEquals('8080', $uri->getPort());
218 $this->assertNull($uri->getPath());
219 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
220 $this->assertEquals('fragment', $uri->getFragment());
221 }
222
223 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
224 public function test_no_query(): void
225 {
226 $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_1);
227 $this->assertEquals('git', $uri->getSchema());
228 $this->assertEquals('one-letter-top-level.a:8080', $uri->getAuthority());
229 $this->assertEquals('one-letter-top-level.a', $uri->getHost());
230 $this->assertEquals('8080', $uri->getPort());
231 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
232 $this->assertNull($uri->getQuery());
233 $this->assertEquals('fragment', $uri->getFragment());
234
235 $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
236 $this->assertEquals('git', $uri->getSchema());
237 $this->assertEquals('github.com:8080', $uri->getAuthority());
238 $this->assertEquals('github.com', $uri->getHost());
239 $this->assertEquals('8080', $uri->getPort());
240 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
241 $this->assertNull($uri->getQuery());
242 $this->assertEquals('fragment', $uri->getFragment());
243 }
244
245 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
246 public function test_authority_and_query(): void
247 {
248 $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_1);
249 $this->assertEquals('git', $uri->getSchema());
250 $this->assertEquals('github.com', $uri->getAuthority());
251 $this->assertEquals('github.com', $uri->getHost());
252 $this->assertNull($uri->getPort());
253 $this->assertNull($uri->getPath());
254 $this->assertEquals('query_p$,;A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
255 $this->assertNull($uri->getFragment());
256
257 $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_QUERY_2);
258 $this->assertEquals('git', $uri->getSchema());
259 $this->assertEquals('github.com', $uri->getAuthority());
260 $this->assertEquals('github.com', $uri->getHost());
261 $this->assertNull($uri->getPort());
262 $this->assertNull($uri->getPath());
263 $this->assertEquals('qu/ery_p$,;A!\'*+()ar_1=val_1&quer?y_par_2=val_2', $uri->getQuery());
264 $this->assertNull($uri->getFragment());
265 }
266
267 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
268 public function test_authority_and_fragment(): void
269 {
270 $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_AND_FRAGMENT);
271 $this->assertEquals('git', $uri->getSchema());
272 $this->assertEquals('github.com:8080', $uri->getAuthority());
273 $this->assertEquals('github.com', $uri->getHost());
274 $this->assertEquals('8080', $uri->getPort());
275 $this->assertNull($uri->getPath());
276 $this->assertNull($uri->getQuery());
277 $this->assertEquals('fragment$,;A!\'*+()ar_1=val_1&', $uri->getFragment());
278 }
279
280 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
281 public function test_authority_path_fragment(): void
282 {
283 $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_PATH_FRAGMENT);
284 $this->assertEquals('git', $uri->getSchema());
285 $this->assertEquals('git$,;hub.com:8080', $uri->getAuthority());
286 $this->assertEquals('git$,;hub.com', $uri->getHost());
287 $this->assertEquals('8080', $uri->getPort());
288 $this->assertEquals('someacc$,;ount/somerepo/somerepo.git', $uri->getPath());
289 $this->assertNull($uri->getQuery());
290 $this->assertEquals('fragA!\'*+()arment', $uri->getFragment());
291 }
292
293 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
294 public function test_path(): void
295 {
296 $uri = new ILIAS\Data\URI(self::URI_PATH);
297 $this->assertEquals('git', $uri->getSchema());
298 $this->assertEquals('git$,;hub.com:8080', $uri->getAuthority());
299 $this->assertEquals('git$,;hub.com', $uri->getHost());
300 $this->assertEquals('8080', $uri->getPort());
301 $this->assertEquals('someacc$,;ount/somerepo/somerepo.git', $uri->getPath());
302 $this->assertNull($uri->getQuery());
303 $this->assertNull($uri->getFragment());
304 $this->assertEquals('git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git', $uri->getBaseURI());
305 }
306
307 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
308 public function test_authority_only(): void
309 {
310 $uri = new ILIAS\Data\URI(self::URI_AUTHORITY_ONLY);
311 $this->assertEquals('git', $uri->getSchema());
312 $this->assertEquals('git$,;hub.com', $uri->getAuthority());
313 $this->assertEquals('git$,;hub.com', $uri->getHost());
314 $this->assertNull($uri->getPort());
315 $this->assertNull($uri->getPath());
316 $this->assertNull($uri->getQuery());
317 $this->assertNull($uri->getFragment());
318 $this->assertEquals('git://git$,;hub.com', $uri->getBaseURI());
319 }
320
321 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
322 public function test_no_schema(): void
323 {
324 $this->expectException(TypeError::class);
325 new ILIAS\Data\URI(self::URI_NO_SCHEMA);
326 }
327
328 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
329 public function test_no_authority(): void
330 {
331 $this->expectException(TypeError::class);
332 new ILIAS\Data\URI(self::URI_NO_AUTHORITY);
333 }
334
335 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
336 public function test_wrong_char_in_schema(): void
337 {
338 $this->expectException(TypeError::class);
339 new ILIAS\Data\URI(self::URI_WRONG_SCHEMA);
340 }
341
342 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
343 public function test_wrong_authority_in_schema_1(): void
344 {
345 $this->expectException(InvalidArgumentException::class);
346 new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_1);
347 }
348
349 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
350 public function test_wrong_authority_in_schema_2(): void
351 {
352 $this->expectException(InvalidArgumentException::class);
353 new ILIAS\Data\URI(self::URI_WRONG_AUTHORITY_2);
354 }
355
356 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
357 public function test_uri_invalid(): void
358 {
359 $this->expectException(InvalidArgumentException::class);
360 new ILIAS\Data\URI(self::URI_INVALID);
361 }
362
363 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
364 public function test_invalid_characters_in_query(): void
365 {
366 $this->expectException(InvalidArgumentException::class);
367 new ILIAS\Data\URI(self::URI_INVALID_CHARACTERS_IN_QUERY);
368 }
369
370 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
371 public function test_realpctenc(): void
372 {
373 $uri = new ILIAS\Data\URI(self::URI_REALPCTENC);
374 $this->assertEquals(self::PATH_REALPCTENC, $uri->getPath());
375 $this->assertEquals(self::PARAMS_REALPCTENC, $uri->getParameters());
376 }
377
378 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
379 public function test_fakepcenc(): void
380 {
381 $this->expectException(InvalidArgumentException::class);
382 new ILIAS\Data\URI(self::URI_FAKEPCENC);
383 }
384
385 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
386 public function test_alphadigit_start_host(): void
387 {
388 $this->expectException(InvalidArgumentException::class);
389 new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_1);
390 }
391
392 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
393 public function test_alphadigit_start_host_2(): void
394 {
395 $this->expectException(InvalidArgumentException::class);
396 new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_2);
397 }
398
399 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
400 public function test_alphadigit_start_host_3(): void
401 {
402 $this->expectException(InvalidArgumentException::class);
403 new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_3);
404 }
405
406 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
407 public function test_alphadigit_start_host_4(): void
408 {
409 $this->expectException(InvalidArgumentException::class);
410 new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_4);
411 }
412
413 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
414 public function test_alphadigit_start_host_5(): void
415 {
416 $this->expectException(InvalidArgumentException::class);
417 new ILIAS\Data\URI(self::URI_HOST_ALPHADIG_START_5);
418 }
419
420 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
421 public function test_with_schema($uri): void
422 {
423 $this->assertEquals('g+it', $uri->getSchema());
424 $this->assertEquals('github.com:8080', $uri->getAuthority());
425 $this->assertEquals('github.com', $uri->getHost());
426 $this->assertEquals('8080', $uri->getPort());
427 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
428 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
429 $this->assertEquals('fragment', $uri->getFragment());
430 $uri = $uri->withSchema('http');
431 $this->assertEquals('http', $uri->getSchema());
432 $this->assertEquals('github.com:8080', $uri->getAuthority());
433 $this->assertEquals('github.com', $uri->getHost());
434 $this->assertEquals('8080', $uri->getPort());
435 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
436 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
437 $this->assertEquals('fragment', $uri->getFragment());
438 }
439
440 #[\PHPUnit\Framework\Attributes\Depends('test_with_schema')]
441 public function test_with_schema_invalid_1(): void
442 {
443 $this->expectException(InvalidArgumentException::class);
444 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
445 $uri->withSchema('');
446 }
447
448 #[\PHPUnit\Framework\Attributes\Depends('test_with_schema')]
449 public function test_with_schema_invalid_2(): void
450 {
451 $this->expectException(InvalidArgumentException::class);
452 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
453 $uri->withSchema('1aa');
454 }
455
456 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
457 public function test_with_port($uri): void
458 {
459 $this->assertEquals('g+it', $uri->getSchema());
460 $this->assertEquals('github.com:8080', $uri->getAuthority());
461 $this->assertEquals('github.com', $uri->getHost());
462 $this->assertEquals('8080', $uri->getPort());
463 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
464 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
465 $this->assertEquals('fragment', $uri->getFragment());
466 $uri = $uri->withPort(80);
467 $this->assertEquals('g+it', $uri->getSchema());
468 $this->assertEquals('github.com:80', $uri->getAuthority());
469 $this->assertEquals('github.com', $uri->getHost());
470 $this->assertEquals('80', $uri->getPort());
471 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
472 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
473 $this->assertEquals('fragment', $uri->getFragment());
474 $uri = $uri->withPort();
475 $this->assertEquals('g+it', $uri->getSchema());
476 $this->assertEquals('github.com', $uri->getAuthority());
477 $this->assertEquals('github.com', $uri->getHost());
478 $this->assertNull($uri->getPort());
479 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
480 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
481 $this->assertEquals('fragment', $uri->getFragment());
482 }
483
484
485 #[\PHPUnit\Framework\Attributes\Depends('test_with_port')]
486 public function test_with_port_invalid_1(): void
487 {
488 $this->expectException(TypeError::class);
489 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
490 $uri->withPort('a111');
491 }
492
493 #[\PHPUnit\Framework\Attributes\Depends('test_with_port')]
494 public function test_with_port_invalid_2(): void
495 {
496 $this->expectException(TypeError::class);
497 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
498 $uri->withPort('foo');
499 }
500
501 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
502 public function test_with_host($uri): void
503 {
504 $this->assertEquals('g+it', $uri->getSchema());
505 $this->assertEquals('github.com:8080', $uri->getAuthority());
506 $this->assertEquals('github.com', $uri->getHost());
507 $this->assertEquals('8080', $uri->getPort());
508 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
509 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
510 $this->assertEquals('fragment', $uri->getFragment());
511 $uri = $uri->withHost('ilias.de');
512 $this->assertEquals('g+it', $uri->getSchema());
513 $this->assertEquals('ilias.de:8080', $uri->getAuthority());
514 $this->assertEquals('ilias.de', $uri->getHost());
515 $this->assertEquals('8080', $uri->getPort());
516 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
517 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
518 $this->assertEquals('fragment', $uri->getFragment());
519 }
520
521 #[\PHPUnit\Framework\Attributes\Depends('test_with_host')]
522 public function test_with_host_invalid_1(): void
523 {
524 $this->expectException(InvalidArgumentException::class);
525 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
526 $uri->withHost('-foo-.de');
527 }
528
529 public function test_with_host_invalid_3(): void
530 {
531 $this->expectException(InvalidArgumentException::class);
532 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
533 $uri->withHost('');
534 }
535
536 #[\PHPUnit\Framework\Attributes\Depends('test_with_host')]
537 public function test_with_host_invalid_4(): void
538 {
539 $this->expectException(InvalidArgumentException::class);
540 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
541 $uri->withHost('ilias.de"><script');
542 }
543
544 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
545 public function test_with_authority($uri): void
546 {
547 $this->assertEquals('g+it', $uri->getSchema());
548 $this->assertEquals('github.com:8080', $uri->getAuthority());
549 $this->assertEquals('github.com', $uri->getHost());
550 $this->assertEquals('8080', $uri->getPort());
551 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
552 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
553 $this->assertEquals('fragment', $uri->getFragment());
554 $uri = $uri->withAuthority('www1.ilias.de');
555 $this->assertEquals('g+it', $uri->getSchema());
556 $this->assertEquals('www1.ilias.de', $uri->getAuthority());
557 $this->assertEquals('www1.ilias.de', $uri->getHost());
558 $this->assertNull($uri->getPort());
559 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
560 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
561 $this->assertEquals('fragment', $uri->getFragment());
562 $uri = $uri->withAuthority('ilias.de:80');
563 $this->assertEquals('g+it', $uri->getSchema());
564 $this->assertEquals('ilias.de:80', $uri->getAuthority());
565 $this->assertEquals('ilias.de', $uri->getHost());
566 $this->assertEquals('80', $uri->getPort());
567 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
568 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
569 $this->assertEquals('fragment', $uri->getFragment());
570 $uri = $uri->withAuthority('a:1');
571 $this->assertEquals('g+it', $uri->getSchema());
572 $this->assertEquals('a:1', $uri->getAuthority());
573 $this->assertEquals('a', $uri->getHost());
574 $this->assertEquals(1, $uri->getPort());
575 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
576 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
577 $this->assertEquals('fragment', $uri->getFragment());
578 $uri = $uri->withAuthority('a');
579 $this->assertEquals('g+it', $uri->getSchema());
580 $this->assertEquals('a', $uri->getAuthority());
581 $this->assertEquals('a', $uri->getHost());
582 $this->assertNull($uri->getPort());
583 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
584 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
585 $this->assertEquals('fragment', $uri->getFragment());
586 $uri = $uri->withAuthority('1.2.3.4');
587 $this->assertEquals('g+it', $uri->getSchema());
588 $this->assertEquals('1.2.3.4', $uri->getAuthority());
589 $this->assertEquals('1.2.3.4', $uri->getHost());
590 $this->assertNull($uri->getPort());
591 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
592 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
593 $this->assertEquals('fragment', $uri->getFragment());
594 $uri = $uri->withAuthority('1.2.3.4:5');
595 $this->assertEquals('g+it', $uri->getSchema());
596 $this->assertEquals('1.2.3.4:5', $uri->getAuthority());
597 $this->assertEquals('1.2.3.4', $uri->getHost());
598 $this->assertEquals(5, $uri->getPort());
599 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
600 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
601 $this->assertEquals('fragment', $uri->getFragment());
602 $uri = $uri->withAuthority('localhost1');
603 $this->assertEquals('g+it', $uri->getSchema());
604 $this->assertEquals('localhost1', $uri->getAuthority());
605 $this->assertEquals('localhost1', $uri->getHost());
606 $this->assertNull($uri->getPort());
607 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
608 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
609 $this->assertEquals('fragment', $uri->getFragment());
610 $uri = $uri->withAuthority('localhost1:10');
611 $this->assertEquals('g+it', $uri->getSchema());
612 $this->assertEquals('localhost1:10', $uri->getAuthority());
613 $this->assertEquals('localhost1', $uri->getHost());
614 $this->assertEquals(10, $uri->getPort());
615 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
616 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
617 $this->assertEquals('fragment', $uri->getFragment());
618 }
619
620 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
621 public function test_with_authority_invalid_1(): void
622 {
623 $this->expectException(InvalidArgumentException::class);
624 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
625 $uri->withAuthority('-foo-.de');
626 }
627
628 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
629 public function test_with_authority_invalid_2(): void
630 {
631 $this->expectException(InvalidArgumentException::class);
632 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
633 $uri->withAuthority('-bar-.de:6060');
634 }
635
636
637 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
638 public function test_with_authority_invalid_3(): void
639 {
640 $this->expectException(InvalidArgumentException::class);
641 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
642 $uri->withHost('ilias.de:');
643 }
644
645 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
646 public function test_with_authority_invalid_4(): void
647 {
648 $this->expectException(InvalidArgumentException::class);
649 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
650 $uri->withHost('ilias.de: ');
651 }
652
653 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
654 public function test_with_authority_invalid_5(): void
655 {
656 $this->expectException(InvalidArgumentException::class);
657 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
658 $uri->withHost('ilias.de:aaa');
659 }
660
661 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
662 public function test_with_authority_invalid_6(): void
663 {
664 $this->expectException(InvalidArgumentException::class);
665 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
666 $uri->withAuthority('foo.de&<script>');
667 }
668
669
670 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
671 public function test_with_authority_invalid_7(): void
672 {
673 $this->expectException(InvalidArgumentException::class);
674 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
675 $uri->withAuthority('foo.de"><script>alert');
676 }
677
678
679 #[\PHPUnit\Framework\Attributes\Depends('test_with_authority')]
680 public function test_with_authority_invalid_8(): void
681 {
682 $this->expectException(InvalidArgumentException::class);
683 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
684 $uri->withAuthority(' :80');
685 }
686
687 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
688 public function test_with_path($uri): void
689 {
690 $this->assertEquals('g+it', $uri->getSchema());
691 $this->assertEquals('github.com:8080', $uri->getAuthority());
692 $this->assertEquals('github.com', $uri->getHost());
693 $this->assertEquals('8080', $uri->getPort());
694 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
695 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
696 $this->assertEquals('fragment', $uri->getFragment());
697 $uri = $uri->withPath('a/b');
698 $this->assertEquals('g+it', $uri->getSchema());
699 $this->assertEquals('github.com:8080', $uri->getAuthority());
700 $this->assertEquals('github.com', $uri->getHost());
701 $this->assertEquals('8080', $uri->getPort());
702 $this->assertEquals('a/b', $uri->getPath());
703 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
704 $this->assertEquals('fragment', $uri->getFragment());
705 $uri = $uri->withPath();
706 $this->assertEquals('g+it', $uri->getSchema());
707 $this->assertEquals('github.com:8080', $uri->getAuthority());
708 $this->assertEquals('github.com', $uri->getHost());
709 $this->assertEquals('8080', $uri->getPort());
710 $this->assertNull($uri->getPath());
711 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
712 $this->assertEquals('fragment', $uri->getFragment());
713 }
714
715 #[\PHPUnit\Framework\Attributes\Depends('test_with_path')]
716 public function test_with_path_invalid_1(): void
717 {
718 $this->expectException(InvalidArgumentException::class);
719 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
720 $uri->withPath('/<script>/a');
721 }
722
723 #[\PHPUnit\Framework\Attributes\Depends('test_with_path')]
724 public function test_with_path_invalid_2(): void
725 {
726 $this->expectException(InvalidArgumentException::class);
727 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
728 $uri->withPath('//a/b');
729 }
730
731 #[\PHPUnit\Framework\Attributes\Depends('test_with_path')]
732 public function test_with_path_invalid_3(): void
733 {
734 $this->expectException(InvalidArgumentException::class);
735 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
736 $uri->withPath(':a/b');
737 }
738
739 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
740 public function test_with_query($uri): void
741 {
742 $this->assertEquals('g+it', $uri->getSchema());
743 $this->assertEquals('github.com:8080', $uri->getAuthority());
744 $this->assertEquals('github.com', $uri->getHost());
745 $this->assertEquals('8080', $uri->getPort());
746 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
747 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
748 $this->assertEquals('fragment', $uri->getFragment());
749 $uri = $uri->withQuery('query_par_a1=val_a1');
750 $this->assertEquals('g+it', $uri->getSchema());
751 $this->assertEquals('github.com:8080', $uri->getAuthority());
752 $this->assertEquals('github.com', $uri->getHost());
753 $this->assertEquals('8080', $uri->getPort());
754 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
755 $this->assertEquals('query_par_a1=val_a1', $uri->getQuery());
756 $this->assertEquals('fragment', $uri->getFragment());
757 $uri = $uri->withQuery();
758 $this->assertEquals('g+it', $uri->getSchema());
759 $this->assertEquals('github.com:8080', $uri->getAuthority());
760 $this->assertEquals('github.com', $uri->getHost());
761 $this->assertEquals('8080', $uri->getPort());
762 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
763 $this->assertNull($uri->getQuery());
764 $this->assertEquals('fragment', $uri->getFragment());
765 }
766
767 #[\PHPUnit\Framework\Attributes\Depends('test_with_query')]
768 public function test_with_query_invalid_1(): void
769 {
770 $this->expectException(InvalidArgumentException::class);
771 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
772 $uri->withQuery('<script>a');
773 }
774
775 #[\PHPUnit\Framework\Attributes\Depends('test_with_query')]
776 public function test_with_query_invalid_2(): void
777 {
778 $this->expectException(InvalidArgumentException::class);
779 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
780 $uri->withQuery('aa[]');
781 }
782
783 #[\PHPUnit\Framework\Attributes\Depends('test_init')]
784 public function test_with_fragment($uri): void
785 {
786 $this->assertEquals('g+it', $uri->getSchema());
787 $this->assertEquals('github.com:8080', $uri->getAuthority());
788 $this->assertEquals('github.com', $uri->getHost());
789 $this->assertEquals('8080', $uri->getPort());
790 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
791 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
792 $this->assertEquals('fragment', $uri->getFragment());
793 $uri = $uri->withFragment('someFragment');
794 $this->assertEquals('g+it', $uri->getSchema());
795 $this->assertEquals('github.com:8080', $uri->getAuthority());
796 $this->assertEquals('github.com', $uri->getHost());
797 $this->assertEquals('8080', $uri->getPort());
798 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
799 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
800 $this->assertEquals('someFragment', $uri->getFragment());
801 $uri = $uri->withFragment();
802 $this->assertEquals('g+it', $uri->getSchema());
803 $this->assertEquals('github.com:8080', $uri->getAuthority());
804 $this->assertEquals('github.com', $uri->getHost());
805 $this->assertEquals('8080', $uri->getPort());
806 $this->assertEquals('someaccount/somerepo/somerepo.git', $uri->getPath());
807 $this->assertEquals('query_par_1=val_1&query_par_2=val_2', $uri->getQuery());
808 $this->assertNull($uri->getFragment());
809 }
810
811 #[\PHPUnit\Framework\Attributes\Depends('test_with_fragment')]
812 public function test_with_fragment_invalid_1(): void
813 {
814 $this->expectException(InvalidArgumentException::class);
815 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
816 $uri->withFragment('aaa[]');
817 }
818
819 #[\PHPUnit\Framework\Attributes\Depends('test_with_fragment')]
820 public function test_with_fragment_invalid_2(): void
821 {
822 $this->expectException(InvalidArgumentException::class);
823 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
824 $uri->withFragment('script>');
825 }
826
827 public function testToString(): void
828 {
829 $uri = new ILIAS\Data\URI(self::URI_COMPLETE);
830 $this->assertEquals(
831 self::URI_COMPLETE,
832 $uri
833 );
834 }
835
836 public function testGetParameters(): ILIAS\Data\URI
837 {
838 $url = self::URI_BASE . '?' . http_build_query(self::PARAMS);
839 $uri = new ILIAS\Data\URI($url);
840 $this->assertEquals(
841 self::PARAMS,
842 $uri->getParameters()
843 );
844 return $uri;
845 }
846
847 #[\PHPUnit\Framework\Attributes\Depends('testGetParameters')]
848 public function testGetParameter(ILIAS\Data\URI $uri): void
849 {
850 $k = array_keys(self::PARAMS)[0];
851 $this->assertEquals(
852 self::PARAMS[$k],
853 $uri->getParameter($k)
854 );
855 }
856
857 #[\PHPUnit\Framework\Attributes\Depends('testGetParameters')]
859 {
860 $params = ['x' => 1, 'y' => 2];
861 $uri = $uri->withParameters($params);
862 $this->assertEquals(
863 $params,
864 $uri->getParameters()
865 );
866 return $uri;
867 }
868
869 #[\PHPUnit\Framework\Attributes\Depends('testWithParameters')]
870 public function testSubstituteParameter(ILIAS\Data\URI $uri): void
871 {
872 $uri = $uri->withParameter('x', 5);
873 $this->assertEquals(
874 5,
875 $uri->getParameter('x')
876 );
877 }
878
879 #[\PHPUnit\Framework\Attributes\Depends('testWithParameters')]
880 public function testAppendParameter(ILIAS\Data\URI $uri): void
881 {
882 $params = [
883 'x' => 1, 'y' => 2,
884 'z' => 5
885 ];
886 $uri = $uri->withParameter('z', 5);
887 $this->assertEquals(
888 $params,
889 $uri->getParameters()
890 );
891 }
892
893 #[\PHPUnit\Framework\Attributes\Depends('testGetParameters')]
894 public function testWithArrayParameters(ILIAS\Data\URI $uri): void
895 {
896 $params = ['x' => 1, 'y' => [10, 11, 12]];
897 $uri = $uri->withParameters($params);
898 $this->assertEquals(
899 $params,
900 $uri->getParameters()
901 );
902 $this->assertEquals(
903 'git://github.com:8080/someaccount/somerepo/somerepo.git?x=1&y%5B0%5D=10&y%5B1%5D=11&y%5B2%5D=12',
904 $uri
905 );
906 $this->assertEquals(
907 $params['y'],
908 $uri->getParameter('y')
909 );
910 }
911
912 public function testWithOutParameters(): void
913 {
914 $uri = new ILIAS\Data\URI(self::URI_NO_QUERY_2);
915 $this->assertEquals(
916 [],
917 $uri->getParameters()
918 );
919
920 $this->assertNull($uri->getParameter('y'));
921
922 $this->assertEquals(
923 self::URI_NO_QUERY_2,
924 (string) $uri
925 );
926 }
927}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
test_with_schema_invalid_2()
Definition: URITest.php:449
test_wrong_char_in_schema()
Definition: URITest.php:336
const URI_AUTHORITY_ONLY
Definition: URITest.php:50
const URI_HOST_ALPHADIG_START_1
Definition: URITest.php:74
test_with_host_invalid_3()
Definition: URITest.php:529
test_with_authority_invalid_2()
Definition: URITest.php:629
testWithParameters(ILIAS\Data\URI $uri)
Definition: URITest.php:858
test_authority_and_query()
Definition: URITest.php:246
const URI_HOST_ALPHADIG_START_4
Definition: URITest.php:77
const PARAMS
Definition: URITest.php:81
const URI_FAKEPCENC
Definition: URITest.php:65
const URI_COMPLETE_IPV4
Definition: URITest.php:30
test_wrong_authority_in_schema_2()
Definition: URITest.php:350
test_with_authority_invalid_4()
Definition: URITest.php:646
test_with_schema($uri)
Definition: URITest.php:421
const URI_HOST_ALPHADIG_START_3
Definition: URITest.php:76
const URI_NO_PATH_1
Definition: URITest.php:35
const URI_NO_QUERY_2
Definition: URITest.php:39
test_with_path_invalid_1()
Definition: URITest.php:716
test_no_path()
Definition: URITest.php:202
test_with_authority_invalid_8()
Definition: URITest.php:680
const URI_NO_AUTHORITY
Definition: URITest.php:54
const URI_COMPLETE
Definition: URITest.php:28
testWithArrayParameters(ILIAS\Data\URI $uri)
Definition: URITest.php:894
const URI_NO_PATH_2
Definition: URITest.php:36
test_with_port_invalid_2()
Definition: URITest.php:494
test_with_schema_invalid_1()
Definition: URITest.php:441
test_alphadigit_start_host()
Definition: URITest.php:386
test_no_schema()
Definition: URITest.php:322
const URI_WRONG_SCHEMA
Definition: URITest.php:56
test_no_authority()
Definition: URITest.php:329
test_with_path($uri)
Definition: URITest.php:688
const URI_AUTHORITY_AND_FRAGMENT
Definition: URITest.php:44
testSubstituteParameter(ILIAS\Data\URI $uri)
Definition: URITest.php:870
test_uri_invalid()
Definition: URITest.php:357
test_fakepcenc()
Definition: URITest.php:379
const URI_REALPCTENC
Definition: URITest.php:67
test_base_uri_idempotent($uri)
Definition: URITest.php:177
test_alphadigit_start_host_4()
Definition: URITest.php:407
test_invalid_characters_in_query()
Definition: URITest.php:364
test_ipv4()
Definition: URITest.php:94
const URI_AUTHORITY_AND_QUERY_2
Definition: URITest.php:42
const URI_WRONG_AUTHORITY_1
Definition: URITest.php:58
test_with_host_invalid_1()
Definition: URITest.php:522
test_with_query_invalid_1()
Definition: URITest.php:768
test_alphadigit_start_host_2()
Definition: URITest.php:393
const URI_COMPLETE_LOCALHOST
Definition: URITest.php:32
const URI_BASE
Definition: URITest.php:80
testWithOutParameters()
Definition: URITest.php:912
test_with_port_invalid_1()
Definition: URITest.php:486
const URI_NO_SCHEMA
Definition: URITest.php:52
testGetParameter(ILIAS\Data\URI $uri)
Definition: URITest.php:848
testToString()
Definition: URITest.php:827
test_realpctenc()
Definition: URITest.php:371
const URI_NO_QUERY_1
Definition: URITest.php:38
test_authority_path_fragment()
Definition: URITest.php:281
test_with_query($uri)
Definition: URITest.php:740
test_with_authority($uri)
Definition: URITest.php:545
test_localhost()
Definition: URITest.php:145
test_with_fragment_invalid_1()
Definition: URITest.php:812
test_with_host_invalid_4()
Definition: URITest.php:537
test_with_authority_invalid_6()
Definition: URITest.php:662
test_with_host($uri)
Definition: URITest.php:502
test_with_authority_invalid_7()
Definition: URITest.php:671
const URI_HOST_ALPHADIG_START_5
Definition: URITest.php:78
test_base_uri($uri)
Definition: URITest.php:171
const URI_AUTHORITY_AND_QUERY_1
Definition: URITest.php:41
const URI_HOST_ALPHADIG_START_2
Definition: URITest.php:75
test_alphadigit_start_host_5()
Definition: URITest.php:414
test_path()
Definition: URITest.php:294
const PARAMS_REALPCTENC
Definition: URITest.php:69
test_with_path_invalid_3()
Definition: URITest.php:732
testIPv6(string $host)
Definition: URITest.php:108
test_with_fragment($uri)
Definition: URITest.php:784
const URI_INVALID
Definition: URITest.php:61
test_components($uri)
Definition: URITest.php:159
testGetParameters()
Definition: URITest.php:836
const PATH_REALPCTENC
Definition: URITest.php:68
test_with_fragment_invalid_2()
Definition: URITest.php:820
test_with_authority_invalid_5()
Definition: URITest.php:654
test_with_path_invalid_2()
Definition: URITest.php:724
test_init()
Definition: URITest.php:88
test_authority_only()
Definition: URITest.php:308
const URI_INVALID_CHARACTERS_IN_QUERY
Definition: URITest.php:63
test_with_query_invalid_2()
Definition: URITest.php:776
test_with_authority_invalid_1()
Definition: URITest.php:621
testAppendParameter(ILIAS\Data\URI $uri)
Definition: URITest.php:880
test_no_query()
Definition: URITest.php:224
test_with_port($uri)
Definition: URITest.php:457
test_authority_and_fragment()
Definition: URITest.php:268
test_wrong_authority_in_schema_1()
Definition: URITest.php:343
const URI_WRONG_AUTHORITY_2
Definition: URITest.php:59
test_with_authority_invalid_3()
Definition: URITest.php:638
const URI_AUTHORITY_PATH_FRAGMENT
Definition: URITest.php:46
static provideIPv6addresses()
Definition: URITest.php:120
test_alphadigit_start_host_3()
Definition: URITest.php:400
const URI_PATH
Definition: URITest.php:48
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:68