File tree Expand file tree Collapse file tree 4 files changed +30
-15
lines changed Expand file tree Collapse file tree 4 files changed +30
-15
lines changed Original file line number Diff line number Diff line change 1
1
parameters :
2
2
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
-
8
3
-
9
4
message : " #^Method Bigcommerce\\\\ Api\\\\ Client\\ :\\ :createCoupon\\ (\\ ) has parameter \\ $object with no type specified\\ .$#"
10
5
count : 1
@@ -500,11 +495,6 @@ parameters:
500
495
count : 1
501
496
path : ../src/Bigcommerce/Api/Filter.php
502
497
503
- -
504
- message : " #^Method Bigcommerce\\\\ Api\\\\ Filter\\ :\\ :__set\\ (\\ ) has no return type specified\\ .$#"
505
- count : 1
506
- path : ../src/Bigcommerce/Api/Filter.php
507
-
508
498
-
509
499
message : " #^Method Bigcommerce\\\\ Api\\\\ Filter\\ :\\ :__set\\ (\\ ) has parameter \\ $parameter with no type specified\\ .$#"
510
500
count : 1
Original file line number Diff line number Diff line change 23
23
"ext-curl" : " *"
24
24
},
25
25
"require-dev" : {
26
- "codeless/jugglecode" : " 1.0" ,
27
26
"friendsofphp/php-cs-fixer" : " ^3.13" ,
28
27
"php-coveralls/php-coveralls" : " 2.5" ,
29
28
"phpunit/phpunit" : " ^9.5" ,
Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ public static function configureOAuth($settings)
115
115
throw new Exception ("'store_hash' must be provided " );
116
116
}
117
117
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
+
118
126
self ::$ client_id = $ settings ['client_id ' ];
119
127
self ::$ auth_token = $ settings ['auth_token ' ];
120
128
self ::$ store_hash = $ settings ['store_hash ' ];
@@ -390,8 +398,8 @@ private static function mapCollectionObject($object)
390
398
* Map a single object to a resource class.
391
399
*
392
400
* @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
395
403
*/
396
404
private static function mapResource ($ resource , $ object )
397
405
{
@@ -407,8 +415,8 @@ private static function mapResource($resource, $object)
407
415
/**
408
416
* Map object representing a count to an integer value.
409
417
*
410
- * @param \stdClass $object
411
- * @return int
418
+ * @param \stdClass|boolean|string $object
419
+ * @return int|boolean
412
420
*/
413
421
private static function mapCount ($ object )
414
422
{
Original file line number Diff line number Diff line change @@ -1084,4 +1084,22 @@ public function testUpdatingOptionValuePutsToTheOptionValueResource()
1084
1084
1085
1085
Client::updateOptionValue (1 , 1 , array ());
1086
1086
}
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
+ }
1087
1105
}
You can’t perform that action at this time.
0 commit comments