@@ -67,7 +67,7 @@ test(function() {
6767 Assert::same (['content-type ' => 'application/json; charset=utf-8 ' ], $ request ->getHeaders ());
6868 Assert::same ('{"foo":"bar"} ' , $ request ->getContent ());
6969
70- ## Object to JSON
70+ # Object to JSON
7171 $ request = $ api ->createRequest ('' , '' , [], [], (object ) ['foo ' => 'bar ' ]);
7272 Assert::same (['content-type ' => 'application/json; charset=utf-8 ' ], $ request ->getHeaders ());
7373 Assert::same ('{"foo":"bar"} ' , $ request ->getContent ());
@@ -97,7 +97,7 @@ test(function() {
9797});
9898
9999
100- # Api called with full URL
100+ # Api called with absolute URL
101101test (function () {
102102 $ client = new MockIClient ;
103103 $ api = new Milo \Github \Api ($ client );
@@ -111,6 +111,16 @@ test(function() {
111111
112112 $ request = $ api ->createRequest ('' , 'uRl://TeSt/path ' , [], [], NULL );
113113 Assert::same ('url://test/path ' , $ request ->getUrl ());
114+
115+ # Absolute HTTPS URL with different host
116+ $ request = $ api ->createRequest ('' , 'https://example.com ' , [], [], NULL );
117+ Assert::same ('https://example.com/ ' , $ request ->getUrl ());
118+ $ request = $ api ->createRequest ('' , 'https://example.com/path ' , [], [], NULL );
119+ Assert::same ('https://example.com/path ' , $ request ->getUrl ());
120+
121+ # Absolute non-HTTPS URL with different host is not allowed (should be?)
122+ $ request = $ api ->createRequest ('' , 'http://example.com ' , [], [], NULL );
123+ Assert::same ('url://test/http://example.com ' , $ request ->getUrl ());
114124});
115125
116126
0 commit comments