File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ protected function normaliseBaseUri(string $baseUri):Uri {
1313 $ host = parse_url ($ baseUri , PHP_URL_HOST )
1414 ?? parse_url ($ baseUri , PHP_URL_PATH );
1515 $ port = parse_url ($ baseUri , PHP_URL_PORT )
16- ?? 80 ;
16+ ?? null ;
1717
1818 $ uri = (new Uri ())
1919 ->withScheme ($ scheme )
Original file line number Diff line number Diff line change @@ -24,6 +24,30 @@ public function testAuthUriHttps() {
2424 "https " ,
2525 $ sut ->getScheme ()
2626 );
27+ self ::assertNull (
28+ $ sut ->getPort ()
29+ );
30+ }
31+
32+ public function testAuthUriWithNonStandardPort () {
33+ $ baseUri = self ::createMock (UriInterface::class);
34+ $ baseUri ->method ("__toString " )
35+ ->willReturn ("http://localhost:8081 " );
36+ $ token = self ::createMock (Token::class);
37+
38+ $ sut = new AuthUri (
39+ $ token ,
40+ "" ,
41+ $ baseUri
42+ );
43+ self ::assertEquals (
44+ "http " ,
45+ $ sut ->getScheme ()
46+ );
47+ self ::assertEquals (
48+ 8081 ,
49+ $ sut ->getPort ()
50+ );
2751 }
2852
2953// All AuthUris MUST be served over HTTPS, with the one exception of localhost.
You can’t perform that action at this time.
0 commit comments