2 require_once(
"libs/composer/vendor/autoload.php");
9 const URI_COMPLETE =
'g+it://github.com:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
11 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';
13 const URI_COMPLETE_LOCALHOST =
'g+it://localhost:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
16 const URI_NO_PATH_1 =
'g-it://ilias%2Da.de:8080?query_par_1=val_1&query_par_2=val_2#fragment';
17 const URI_NO_PATH_2 =
'g.it://amaz;on.co.uk:8080/?query_par_1=val_1&query_par_2=val_2#fragment';
19 const URI_NO_QUERY_1 =
'git://one-letter-top-level.a:8080/someaccount/somerepo/somerepo.git/#fragment';
20 const URI_NO_QUERY_2 =
'git://github.com:8080/someaccount/somerepo/somerepo.git#fragment';
29 const URI_PATH =
'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/';
33 const URI_NO_SCHEMA =
'git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git/';
35 const URI_NO_AUTHORITY =
'git://:8080/someaccount/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
43 const URI_INVALID =
'https://host.de/ilias.php/"><script>alert(1)</script>?baseClass=ilObjChatroomGUI&cmd=getOSDNotifications&cmdMode=asynch&max_age=15192913';
45 const URI_FAKEPCENC =
'g+it://github.com:8080/someaccoun%t/somerepo/somerepo.git/?query_par_1=val_1&query_par_2=val_2#fragment';
68 $this->assertEquals($uri->getSchema(),
'g+it');
69 $this->assertEquals($uri->getAuthority(),
'10.0.0.86:8080');
70 $this->assertEquals($uri->getHost(),
'10.0.0.86');
71 $this->assertEquals($uri->getPort(), 8080);
72 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
73 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
74 $this->assertEquals($uri->getFragment(),
'fragment');
84 $this->assertEquals($uri->getSchema(),
'g+it');
85 $this->assertEquals($uri->getAuthority(),
'localhost:8080');
86 $this->assertEquals($uri->getHost(),
'localhost');
87 $this->assertEquals($uri->getPort(), 8080);
88 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
89 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
90 $this->assertEquals($uri->getFragment(),
'fragment');
99 $this->assertEquals($uri->getSchema(),
'g+it');
100 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
101 $this->assertEquals($uri->getHost(),
'github.com');
102 $this->assertEquals($uri->getPort(),
'8080');
103 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
104 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
105 $this->assertEquals($uri->getFragment(),
'fragment');
113 $this->assertEquals($uri->getBaseURI(),
'g+it://github.com:8080/someaccount/somerepo/somerepo.git');
121 $base_uri = $uri->getBaseURI();
122 $this->assertEquals($base_uri,
'g+it://github.com:8080/someaccount/somerepo/somerepo.git');
123 $this->assertEquals($uri->getSchema(),
'g+it');
124 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
125 $this->assertEquals($uri->getHost(),
'github.com');
126 $this->assertEquals($uri->getPort(),
'8080');
127 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
128 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
129 $this->assertEquals($uri->getFragment(),
'fragment');
132 $this->assertEquals($base_uri, $uri->getBaseURI());
133 $this->assertEquals($uri->getSchema(),
'g+it');
134 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
135 $this->assertEquals($uri->getHost(),
'github.com');
136 $this->assertEquals($uri->getPort(),
'8080');
137 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
138 $this->assertNull($uri->getQuery());
139 $this->assertNull($uri->getFragment());
149 $this->assertEquals($uri->getSchema(),
'g-it');
150 $this->assertEquals($uri->getAuthority(),
'ilias%2Da.de:8080');
151 $this->assertEquals($uri->getHost(),
'ilias%2Da.de');
152 $this->assertEquals($uri->getPort(),
'8080');
153 $this->assertNull($uri->getPath());
154 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
155 $this->assertEquals($uri->getFragment(),
'fragment');
158 $this->assertEquals($uri->getSchema(),
'g.it');
159 $this->assertEquals($uri->getAuthority(),
'amaz;on.co.uk:8080');
160 $this->assertEquals($uri->getHost(),
'amaz;on.co.uk');
161 $this->assertEquals($uri->getPort(),
'8080');
162 $this->assertNull($uri->getPath());
163 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
164 $this->assertEquals($uri->getFragment(),
'fragment');
173 $this->assertEquals($uri->getSchema(),
'git');
174 $this->assertEquals($uri->getAuthority(),
'one-letter-top-level.a:8080');
175 $this->assertEquals($uri->getHost(),
'one-letter-top-level.a');
176 $this->assertEquals($uri->getPort(),
'8080');
177 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
178 $this->assertNull($uri->getQuery());
179 $this->assertEquals($uri->getFragment(),
'fragment');
182 $this->assertEquals($uri->getSchema(),
'git');
183 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
184 $this->assertEquals($uri->getHost(),
'github.com');
185 $this->assertEquals($uri->getPort(),
'8080');
186 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
187 $this->assertNull($uri->getQuery());
188 $this->assertEquals($uri->getFragment(),
'fragment');
197 $this->assertEquals($uri->getSchema(),
'git');
198 $this->assertEquals($uri->getAuthority(),
'github.com');
199 $this->assertEquals($uri->getHost(),
'github.com');
200 $this->assertNull($uri->getPort());
201 $this->assertNull($uri->getPath());
202 $this->assertEquals($uri->getQuery(),
'query_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2');
203 $this->assertNull($uri->getFragment());
206 $this->assertEquals($uri->getSchema(),
'git');
207 $this->assertEquals($uri->getAuthority(),
'github.com');
208 $this->assertEquals($uri->getHost(),
'github.com');
209 $this->assertNull($uri->getPort());
210 $this->assertNull($uri->getPath());
211 $this->assertEquals($uri->getQuery(),
'qu/ery_p$,;:A!\'*+()ar_1=val_1&quer?y_par_2=val_2');
212 $this->assertNull($uri->getFragment());
221 $this->assertEquals($uri->getSchema(),
'git');
222 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
223 $this->assertEquals($uri->getHost(),
'github.com');
224 $this->assertEquals($uri->getPort(),
'8080');
225 $this->assertNull($uri->getPath());
226 $this->assertNull($uri->getQuery());
227 $this->assertEquals($uri->getFragment(),
'fragment$,;:A!\'*+()ar_1=val_1&');
235 $this->assertEquals($uri->getSchema(),
'git');
236 $this->assertEquals($uri->getAuthority(),
'git$,;hub.com:8080');
237 $this->assertEquals($uri->getHost(),
'git$,;hub.com');
238 $this->assertEquals($uri->getPort(),
'8080');
239 $this->assertEquals($uri->getPath(),
'someacc$,;ount/somerepo/somerepo.git');
240 $this->assertNull($uri->getQuery());
241 $this->assertEquals($uri->getFragment(),
'frag:A!\'*+()arment');
250 $this->assertEquals($uri->getSchema(),
'git');
251 $this->assertEquals($uri->getAuthority(),
'git$,;hub.com:8080');
252 $this->assertEquals($uri->getHost(),
'git$,;hub.com');
253 $this->assertEquals($uri->getPort(),
'8080');
254 $this->assertEquals($uri->getPath(),
'someacc$,;ount/somerepo/somerepo.git');
255 $this->assertNull($uri->getQuery());
256 $this->assertNull($uri->getFragment());
257 $this->assertEquals($uri->getBaseURI(),
'git://git$,;hub.com:8080/someacc$,;ount/somerepo/somerepo.git');
266 $this->assertEquals($uri->getSchema(),
'git');
267 $this->assertEquals($uri->getAuthority(),
'git$,;hub.com');
268 $this->assertEquals($uri->getHost(),
'git$,;hub.com');
269 $this->assertNull($uri->getPort());
270 $this->assertNull($uri->getPath());
271 $this->assertNull($uri->getQuery());
272 $this->assertNull($uri->getFragment());
273 $this->assertEquals($uri->getBaseURI(),
'git://git$,;hub.com');
281 $this->expectException(\TypeError::class);
290 $this->expectException(\TypeError::class);
299 $this->expectException(\TypeError::class);
308 $this->expectException(\InvalidArgumentException::class);
317 $this->expectException(\InvalidArgumentException::class);
326 $this->expectException(\InvalidArgumentException::class);
335 $this->expectException(\InvalidArgumentException::class);
344 $this->expectException(\InvalidArgumentException::class);
353 $this->expectException(\InvalidArgumentException::class);
362 $this->expectException(\InvalidArgumentException::class);
371 $this->expectException(\InvalidArgumentException::class);
380 $this->expectException(\InvalidArgumentException::class);
389 $this->assertEquals($uri->getSchema(),
'g+it');
390 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
391 $this->assertEquals($uri->getHost(),
'github.com');
392 $this->assertEquals($uri->getPort(),
'8080');
393 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
394 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
395 $this->assertEquals($uri->getFragment(),
'fragment');
396 $uri = $uri->withSchema(
'http');
397 $this->assertEquals($uri->getSchema(),
'http');
398 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
399 $this->assertEquals($uri->getHost(),
'github.com');
400 $this->assertEquals($uri->getPort(),
'8080');
401 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
402 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
403 $this->assertEquals($uri->getFragment(),
'fragment');
411 $this->expectException(\InvalidArgumentException::class);
413 $uri->withSchema(
'');
421 $this->expectException(\InvalidArgumentException::class);
423 $uri->withSchema(
'1aa');
431 $this->assertEquals($uri->getSchema(),
'g+it');
432 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
433 $this->assertEquals($uri->getHost(),
'github.com');
434 $this->assertEquals($uri->getPort(),
'8080');
435 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
436 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
437 $this->assertEquals($uri->getFragment(),
'fragment');
438 $uri = $uri->withPort(80);
439 $this->assertEquals($uri->getSchema(),
'g+it');
440 $this->assertEquals($uri->getAuthority(),
'github.com:80');
441 $this->assertEquals($uri->getHost(),
'github.com');
442 $this->assertEquals($uri->getPort(),
'80');
443 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
444 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
445 $this->assertEquals($uri->getFragment(),
'fragment');
446 $uri = $uri->withPort();
447 $this->assertEquals($uri->getSchema(),
'g+it');
448 $this->assertEquals($uri->getAuthority(),
'github.com');
449 $this->assertEquals($uri->getHost(),
'github.com');
450 $this->assertNull($uri->getPort());
451 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
452 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
453 $this->assertEquals($uri->getFragment(),
'fragment');
462 $this->expectException(\TypeError::class);
464 $uri->withPort(
'a111');
472 $this->expectException(\TypeError::class);
474 $uri->withPort(
'foo');
482 $this->assertEquals($uri->getSchema(),
'g+it');
483 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
484 $this->assertEquals($uri->getHost(),
'github.com');
485 $this->assertEquals($uri->getPort(),
'8080');
486 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
487 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
488 $this->assertEquals($uri->getFragment(),
'fragment');
489 $uri = $uri->withHost(
'ilias.de');
490 $this->assertEquals($uri->getSchema(),
'g+it');
491 $this->assertEquals($uri->getAuthority(),
'ilias.de:8080');
492 $this->assertEquals($uri->getHost(),
'ilias.de');
493 $this->assertEquals($uri->getPort(),
'8080');
494 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
495 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
496 $this->assertEquals($uri->getFragment(),
'fragment');
505 $this->expectException(\InvalidArgumentException::class);
507 $uri->withHost(
'-foo-.de');
515 $this->expectException(\InvalidArgumentException::class);
525 $this->expectException(\InvalidArgumentException::class);
527 $uri->withHost(
'ilias.de"><script');
535 $this->assertEquals($uri->getSchema(),
'g+it');
536 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
537 $this->assertEquals($uri->getHost(),
'github.com');
538 $this->assertEquals($uri->getPort(),
'8080');
539 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
540 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
541 $this->assertEquals($uri->getFragment(),
'fragment');
542 $uri = $uri->withAuthority(
'www1.ilias.de');
543 $this->assertEquals($uri->getSchema(),
'g+it');
544 $this->assertEquals($uri->getAuthority(),
'www1.ilias.de');
545 $this->assertEquals($uri->getHost(),
'www1.ilias.de');
546 $this->assertNull($uri->getPort());
547 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
548 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
549 $this->assertEquals($uri->getFragment(),
'fragment');
550 $uri = $uri->withAuthority(
'ilias.de:80');
551 $this->assertEquals($uri->getSchema(),
'g+it');
552 $this->assertEquals($uri->getAuthority(),
'ilias.de:80');
553 $this->assertEquals($uri->getHost(),
'ilias.de');
554 $this->assertEquals($uri->getPort(),
'80');
555 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
556 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
557 $this->assertEquals($uri->getFragment(),
'fragment');
558 $uri = $uri->withAuthority(
'a:1');
559 $this->assertEquals($uri->getSchema(),
'g+it');
560 $this->assertEquals($uri->getAuthority(),
'a:1');
561 $this->assertEquals($uri->getHost(),
'a');
562 $this->assertEquals($uri->getPort(), 1);
563 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
564 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
565 $this->assertEquals($uri->getFragment(),
'fragment');
566 $uri = $uri->withAuthority(
'a');
567 $this->assertEquals($uri->getSchema(),
'g+it');
568 $this->assertEquals($uri->getAuthority(),
'a');
569 $this->assertEquals($uri->getHost(),
'a');
570 $this->assertNull($uri->getPort());
571 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
572 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
573 $this->assertEquals($uri->getFragment(),
'fragment');
574 $uri = $uri->withAuthority(
'1.2.3.4');
575 $this->assertEquals($uri->getSchema(),
'g+it');
576 $this->assertEquals($uri->getAuthority(),
'1.2.3.4');
577 $this->assertEquals($uri->getHost(),
'1.2.3.4');
578 $this->assertNull($uri->getPort());
579 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
580 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
581 $this->assertEquals($uri->getFragment(),
'fragment');
582 $uri = $uri->withAuthority(
'1.2.3.4:5');
583 $this->assertEquals($uri->getSchema(),
'g+it');
584 $this->assertEquals($uri->getAuthority(),
'1.2.3.4:5');
585 $this->assertEquals($uri->getHost(),
'1.2.3.4');
586 $this->assertEquals($uri->getPort(), 5);
587 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
588 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
589 $this->assertEquals($uri->getFragment(),
'fragment');
590 $uri = $uri->withAuthority(
'localhost1');
591 $this->assertEquals($uri->getSchema(),
'g+it');
592 $this->assertEquals($uri->getAuthority(),
'localhost1');
593 $this->assertEquals($uri->getHost(),
'localhost1');
594 $this->assertNull($uri->getPort());
595 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
596 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
597 $this->assertEquals($uri->getFragment(),
'fragment');
598 $uri = $uri->withAuthority(
'localhost1:10');
599 $this->assertEquals($uri->getSchema(),
'g+it');
600 $this->assertEquals($uri->getAuthority(),
'localhost1:10');
601 $this->assertEquals($uri->getHost(),
'localhost1');
602 $this->assertEquals($uri->getPort(), 10);
603 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
604 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
605 $this->assertEquals($uri->getFragment(),
'fragment');
613 $this->expectException(\InvalidArgumentException::class);
615 $uri->withAuthority(
'-foo-.de');
623 $this->expectException(\InvalidArgumentException::class);
625 $uri->withAuthority(
'-bar-.de:6060');
634 $this->expectException(\InvalidArgumentException::class);
636 $uri->withHost(
'ilias.de:');
644 $this->expectException(\InvalidArgumentException::class);
646 $uri->withHost(
'ilias.de: ');
654 $this->expectException(\InvalidArgumentException::class);
656 $uri->withHost(
'ilias.de:aaa');
664 $this->expectException(\InvalidArgumentException::class);
666 $uri->withAuthority(
'foo.de&<script>');
675 $this->expectException(\InvalidArgumentException::class);
677 $uri->withAuthority(
'foo.de"><script>alert');
686 $this->expectException(\InvalidArgumentException::class);
688 $uri->withAuthority(
' :80');
696 $this->assertEquals($uri->getSchema(),
'g+it');
697 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
698 $this->assertEquals($uri->getHost(),
'github.com');
699 $this->assertEquals($uri->getPort(),
'8080');
700 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
701 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
702 $this->assertEquals($uri->getFragment(),
'fragment');
703 $uri = $uri->withPath(
'a/b');
704 $this->assertEquals($uri->getSchema(),
'g+it');
705 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
706 $this->assertEquals($uri->getHost(),
'github.com');
707 $this->assertEquals($uri->getPort(),
'8080');
708 $this->assertEquals($uri->getPath(),
'a/b');
709 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
710 $this->assertEquals($uri->getFragment(),
'fragment');
711 $uri = $uri->withPath();
712 $this->assertEquals($uri->getSchema(),
'g+it');
713 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
714 $this->assertEquals($uri->getHost(),
'github.com');
715 $this->assertEquals($uri->getPort(),
'8080');
716 $this->assertNull($uri->getPath());
717 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
718 $this->assertEquals($uri->getFragment(),
'fragment');
726 $this->expectException(\InvalidArgumentException::class);
728 $uri->withPath(
'/<script>/a');
736 $this->expectException(\InvalidArgumentException::class);
738 $uri->withPath(
'//a/b');
746 $this->expectException(\InvalidArgumentException::class);
748 $uri->withPath(
':a/b');
756 $this->assertEquals($uri->getSchema(),
'g+it');
757 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
758 $this->assertEquals($uri->getHost(),
'github.com');
759 $this->assertEquals($uri->getPort(),
'8080');
760 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
761 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
762 $this->assertEquals($uri->getFragment(),
'fragment');
763 $uri = $uri->withQuery(
'query_par_a1=val_a1');
764 $this->assertEquals($uri->getSchema(),
'g+it');
765 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
766 $this->assertEquals($uri->getHost(),
'github.com');
767 $this->assertEquals($uri->getPort(),
'8080');
768 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
769 $this->assertEquals($uri->getQuery(),
'query_par_a1=val_a1');
770 $this->assertEquals($uri->getFragment(),
'fragment');
771 $uri = $uri->withQuery();
772 $this->assertEquals($uri->getSchema(),
'g+it');
773 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
774 $this->assertEquals($uri->getHost(),
'github.com');
775 $this->assertEquals($uri->getPort(),
'8080');
776 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
777 $this->assertNull($uri->getQuery());
778 $this->assertEquals($uri->getFragment(),
'fragment');
786 $this->expectException(\InvalidArgumentException::class);
788 $uri->withQuery(
'<script>a');
796 $this->expectException(\InvalidArgumentException::class);
798 $uri->withQuery(
'aa[]');
806 $this->assertEquals($uri->getSchema(),
'g+it');
807 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
808 $this->assertEquals($uri->getHost(),
'github.com');
809 $this->assertEquals($uri->getPort(),
'8080');
810 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
811 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
812 $this->assertEquals($uri->getFragment(),
'fragment');
813 $uri = $uri->withFragment(
'someFragment');
814 $this->assertEquals($uri->getSchema(),
'g+it');
815 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
816 $this->assertEquals($uri->getHost(),
'github.com');
817 $this->assertEquals($uri->getPort(),
'8080');
818 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
819 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
820 $this->assertEquals($uri->getFragment(),
'someFragment');
821 $uri = $uri->withFragment();
822 $this->assertEquals($uri->getSchema(),
'g+it');
823 $this->assertEquals($uri->getAuthority(),
'github.com:8080');
824 $this->assertEquals($uri->getHost(),
'github.com');
825 $this->assertEquals($uri->getPort(),
'8080');
826 $this->assertEquals($uri->getPath(),
'someaccount/somerepo/somerepo.git');
827 $this->assertEquals($uri->getQuery(),
'query_par_1=val_1&query_par_2=val_2');
828 $this->assertNull($uri->getFragment());
836 $this->expectException(\InvalidArgumentException::class);
838 $uri->withFragment(
'aaa[]');
846 $this->expectException(\InvalidArgumentException::class);
848 $uri->withFragment(
'script>');
test_with_authority_invalid_3()
test_with_authority
const URI_HOST_ALPHADIG_START_2
test_with_path_invalid_3()
test_with_path
test_alphadigit_start_host_5()
test_init
const URI_COMPLETE_LOCALHOST
test_base_uri_idempotent($uri)
test_init
const URI_HOST_ALPHADIG_START_3
test_with_authority_invalid_7()
test_with_authority
test_with_authority_invalid_6()
test_with_authority
test_authority_only()
test_init
test_wrong_authority_in_schema_1()
test_init
test_with_authority_invalid_4()
test_with_authority
test_with_path_invalid_2()
test_with_path
test_with_fragment($uri)
test_init
test_with_authority_invalid_2()
test_with_authority
test_with_host_invalid_4()
test_with_host
const URI_HOST_ALPHADIG_START_1
test_alphadigit_start_host_4()
test_init
test_fakepcenc()
test_init
const URI_AUTHORITY_AND_FRAGMENT
const URI_HOST_ALPHADIG_START_5
test_with_authority_invalid_1()
test_with_authority
test_no_authority()
test_init
test_with_host_invalid_1()
test_with_host
test_with_schema($uri)
test_init
test_wrong_char_in_schema()
test_init
test_with_query_invalid_1()
test_with_query
const URI_WRONG_AUTHORITY_1
test_with_fragment_invalid_1()
test_with_fragment
test_with_query_invalid_2()
test_with_query
test_with_fragment_invalid_2()
test_with_fragment
const URI_HOST_ALPHADIG_START_4
test_with_port_invalid_1()
test_with_port
test_with_host_invalid_3()
test_with_host
test_with_query($uri)
test_init
test_with_authority_invalid_8()
test_with_authority
test_authority_path_fragment()
test_init
test_base_uri($uri)
test_init
test_with_host($uri)
test_init
test_with_path($uri)
test_init
test_authority_and_query()
test_init
const URI_AUTHORITY_AND_QUERY_2
test_with_port($uri)
test_init
test_with_authority($uri)
test_init
test_alphadigit_start_host_3()
test_init
test_alphadigit_start_host_2()
test_init
test_with_authority_invalid_5()
test_with_authority
test_no_schema()
test_init
test_localhost()
test_init
test_with_schema_invalid_1()
test_with_schema
test_uri_invalid()
test_init
test_components($uri)
test_init
test_with_port_invalid_2()
test_with_port
test_authority_and_fragment()
test_init
const URI_AUTHORITY_PATH_FRAGMENT
test_wrong_authority_in_schema_2()
test_init
const URI_AUTHORITY_AND_QUERY_1
test_alphadigit_start_host()
test_init
test_with_path_invalid_1()
test_with_path
test_with_schema_invalid_2()
test_with_schema
const URI_WRONG_AUTHORITY_2