@@ -32,25 +32,25 @@ var_dump($uri6->getHost());
3232try {
3333 $ uri3 ->withHost ("test.com:8080 " );
3434} catch (Uri \InvalidUriException $ e ) {
35- echo $ e ->getMessage () . "\n" ;
35+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
3636}
3737
3838try {
3939 $ uri3 ->withHost ("t%3As%2Ft.com " ); // t:s/t.com
4040} catch (Uri \InvalidUriException $ e ) {
41- echo $ e ->getMessage () . "\n" ;
41+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
4242}
4343
4444try {
4545 $ uri3 ->withHost ("t:s/t.com " );
4646} catch (Uri \InvalidUriException $ e ) {
47- echo $ e ->getMessage () . "\n" ;
47+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
4848}
4949
5050try {
5151 $ uri2 ->withHost ("" );
5252} catch (Uri \InvalidUriException $ e ) {
53- echo $ e ->getMessage () . "\n" ;
53+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
5454}
5555
5656$ uri1 = Uri \Rfc3986 \Uri::parse ("ftp://user:pass@foo.com?query=abc#foo " );
@@ -62,7 +62,7 @@ var_dump($uri2->getHost());
6262try {
6363 $ uri1 ->withHost (null );
6464} catch (Uri \InvalidUriException $ e ) {
65- echo $ e ->getMessage () . "\n" ;
65+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
6666}
6767
6868$ url1 = Uri \WhatWg \Url::parse ("https://example.com " );
@@ -80,25 +80,25 @@ var_dump($url5->getAsciiHost());
8080try {
8181 $ url3 ->withHost ("test.com:8080 " );
8282} catch (Uri \WhatWg \InvalidUrlException $ e ) {
83- echo $ e ->getMessage () . "\n" ;
83+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
8484}
8585
8686try {
8787 $ url3 ->withHost ("t%3As%2Ft.com " ); // t:s/t.com
8888} catch (Uri \WhatWg \InvalidUrlException $ e ) {
89- echo $ e ->getMessage () . "\n" ;
89+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
9090}
9191
9292try {
9393 $ url3 ->withHost ("t:s/t.com " ); // t:s/t.com
9494} catch (Uri \WhatWg \InvalidUrlException $ e ) {
95- echo $ e ->getMessage () . "\n" ;
95+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
9696}
9797
9898try {
9999 $ url2 ->withHost (null );
100100} catch (Uri \WhatWg \InvalidUrlException $ e ) {
101- echo $ e ->getMessage () . "\n" ;
101+ echo $ e::class, ' : ' , $ e ->getMessage (), \ PHP_EOL ;
102102}
103103
104104$ url1 = Uri \WhatWg \Url::parse ("ftp://foo.com?query=abc#foo " );
@@ -121,19 +121,19 @@ string(11) "192.168.0.1"
121121string(11) "192.168.0.1"
122122string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
123123string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
124- The specified host is malformed
125- The specified host is malformed
124+ Uri\InvalidUriException: The specified host is malformed
125+ Uri\InvalidUriException: The specified host is malformed
126126string(7) "foo.com"
127127string(8) "test.com"
128- Cannot remove the host from a URI that has a userinfo
128+ Uri\InvalidUriException: Cannot remove the host from a URI that has a userinfo
129129string(11) "example.com"
130130string(8) "test.com"
131131string(8) "test.com"
132132string(11) "192.168.0.1"
133133string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]"
134- The specified host is malformed
135- The specified host is malformed (DomainInvalidCodePoint)
136- The specified host is malformed
137- The specified host is malformed (HostMissing)
134+ Uri\WhatWg\InvalidUrlException: The specified host is malformed
135+ Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)
136+ Uri\WhatWg\InvalidUrlException: The specified host is malformed
137+ Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing)
138138string(7) "foo.com"
139139string(8) "test.com"
0 commit comments