@@ -30,25 +30,25 @@ var_dump($uri6->getHost());
3030try {
3131 $ uri3 ->withHost ("test.com:8080 " );
3232} catch (Uri \InvalidUriException $ e ) {
33- echo $ e ->getMessage () . "\n" ;
33+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
3434}
3535
3636try {
3737 $ uri3 ->withHost ("t%3As%2Ft.com " ); // t:s/t.com
3838} catch (Uri \InvalidUriException $ e ) {
39- echo $ e ->getMessage () . "\n" ;
39+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
4040}
4141
4242try {
4343 $ uri3 ->withHost ("t:s/t.com " );
4444} catch (Uri \InvalidUriException $ e ) {
45- echo $ e ->getMessage () . "\n" ;
45+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
4646}
4747
4848try {
4949 $ uri2 ->withHost ("" );
5050} catch (Uri \InvalidUriException $ e ) {
51- echo $ e ->getMessage () . "\n" ;
51+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
5252}
5353
5454$ uri1 = Uri \Rfc3986 \Uri::parse ("ftp://user:pass@foo.com?query=abc#foo " );
@@ -60,7 +60,7 @@ var_dump($uri2->getHost());
6060try {
6161 $ uri1 ->withHost (null );
6262} catch (Uri \InvalidUriException $ e ) {
63- echo $ e ->getMessage () . "\n" ;
63+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
6464}
6565
6666$ url1 = Uri \WhatWg \Url::parse ("https://example.com " );
@@ -78,25 +78,25 @@ var_dump($url5->getAsciiHost());
7878try {
7979 $ url3 ->withHost ("test.com:8080 " );
8080} catch (Uri \WhatWg \InvalidUrlException $ e ) {
81- echo $ e ->getMessage () . "\n" ;
81+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
8282}
8383
8484try {
8585 $ url3 ->withHost ("t%3As%2Ft.com " ); // t:s/t.com
8686} catch (Uri \WhatWg \InvalidUrlException $ e ) {
87- echo $ e ->getMessage () . "\n" ;
87+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
8888}
8989
9090try {
9191 $ url3 ->withHost ("t:s/t.com " ); // t:s/t.com
9292} catch (Uri \WhatWg \InvalidUrlException $ e ) {
93- echo $ e ->getMessage () . "\n" ;
93+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
9494}
9595
9696try {
9797 $ url2 ->withHost (null );
9898} catch (Uri \WhatWg \InvalidUrlException $ e ) {
99- echo $ e ->getMessage () . "\n" ;
99+ echo $ e::class, ' : ' , $ e ->getMessage (), "\n" ;
100100}
101101
102102$ url1 = Uri \WhatWg \Url::parse ("ftp://foo.com?query=abc#foo " );
@@ -119,19 +119,19 @@ string(11) "192.168.0.1"
119119string(11) "192.168.0.1"
120120string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
121121string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
122- The specified host is malformed
123- The specified host is malformed
122+ Uri\InvalidUriException: The specified host is malformed
123+ Uri\InvalidUriException: The specified host is malformed
124124string(7) "foo.com"
125125string(8) "test.com"
126- Cannot remove the host from a URI that has a userinfo
126+ Uri\InvalidUriException: Cannot remove the host from a URI that has a userinfo
127127string(11) "example.com"
128128string(8) "test.com"
129129string(8) "test.com"
130130string(11) "192.168.0.1"
131131string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
132- The specified host is malformed
133- The specified host is malformed (DomainInvalidCodePoint)
134- The specified host is malformed
135- The specified host is malformed (HostMissing)
132+ Uri\WhatWg\InvalidUrlException: The specified host is malformed
133+ Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)
134+ Uri\WhatWg\InvalidUrlException: The specified host is malformed
135+ Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing)
136136string(7) "foo.com"
137137string(8) "test.com"
0 commit comments