File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ public static function configureOAuth($settings)
115115 throw new Exception ("'store_hash' must be provided " );
116116 }
117117
118+ if (isset ($ settings ['api_url ' ])) {
119+ self ::$ api_url = $ settings ['api_url ' ];
120+ }
121+
122+ if (isset ($ settings ['login_url ' ])) {
123+ self ::$ login_url = $ settings ['login_url ' ];
124+ }
125+
118126 self ::$ client_id = $ settings ['client_id ' ];
119127 self ::$ auth_token = $ settings ['auth_token ' ];
120128 self ::$ store_hash = $ settings ['store_hash ' ];
Original file line number Diff line number Diff line change @@ -1084,4 +1084,22 @@ public function testUpdatingOptionValuePutsToTheOptionValueResource()
10841084
10851085 Client::updateOptionValue (1 , 1 , array ());
10861086 }
1087+
1088+ public function testConnectionUsesApiUrlOverride ()
1089+ {
1090+ $ this ->connection ->expects ($ this ->once ())
1091+ ->method ('get ' )
1092+ ->with ('https://api.url.com/time ' );
1093+
1094+ Client::configureOAuth ([
1095+ 'client_id ' => '123 ' ,
1096+ 'auth_token ' => '123xyz ' ,
1097+ 'store_hash ' => 'abc123 ' ,
1098+ 'api_url ' => 'https://api.url.com ' ,
1099+ 'login_url ' => 'https://login.url.com ' ,
1100+ ]);
1101+ Client::setConnection ($ this ->connection ); // re-set the connection since Client::setConnection unsets it
1102+
1103+ Client::getTime ();
1104+ }
10871105}
You can’t perform that action at this time.
0 commit comments