File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11parameters :
22 ignoreErrors :
3- -
4- message : " #^Call to function is_string\\ (\\ ) with stdClass will always evaluate to false\\ .$#"
5- count : 2
6- path : ../src/Bigcommerce/Api/Client.php
7-
83 -
94 message : " #^Method Bigcommerce\\\\ Api\\\\ Client\\ :\\ :createCoupon\\ (\\ ) has parameter \\ $object with no type specified\\ .$#"
105 count : 1
@@ -500,11 +495,6 @@ parameters:
500495 count : 1
501496 path : ../src/Bigcommerce/Api/Filter.php
502497
503- -
504- message : " #^Method Bigcommerce\\\\ Api\\\\ Filter\\ :\\ :__set\\ (\\ ) has no return type specified\\ .$#"
505- count : 1
506- path : ../src/Bigcommerce/Api/Filter.php
507-
508498 -
509499 message : " #^Method Bigcommerce\\\\ Api\\\\ Filter\\ :\\ :__set\\ (\\ ) has parameter \\ $parameter with no type specified\\ .$#"
510500 count : 1
Original file line number Diff line number Diff line change 2323 "ext-curl" : " *"
2424 },
2525 "require-dev" : {
26- "codeless/jugglecode" : " 1.0" ,
2726 "friendsofphp/php-cs-fixer" : " ^3.13" ,
2827 "php-coveralls/php-coveralls" : " 2.5" ,
2928 "phpunit/phpunit" : " ^9.5" ,
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 ' ];
@@ -390,8 +398,8 @@ private static function mapCollectionObject($object)
390398 * Map a single object to a resource class.
391399 *
392400 * @param string $resource name of the resource class
393- * @param \stdClass $object
394- * @return Resource
401+ * @param \stdClass|boolean|string $object
402+ * @return bool|\stdClass|string
395403 */
396404 private static function mapResource ($ resource , $ object )
397405 {
@@ -407,8 +415,8 @@ private static function mapResource($resource, $object)
407415 /**
408416 * Map object representing a count to an integer value.
409417 *
410- * @param \stdClass $object
411- * @return int
418+ * @param \stdClass|boolean|string $object
419+ * @return int|boolean
412420 */
413421 private static function mapCount ($ object )
414422 {
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