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