Closed lorenzoferrarajr closed 8 years ago
On line 163 of ZendService/Twitter/Twitter.php
:
$this->setHttpClient($accessToken->getHttpClient($oauthOptions, static::OAUTH_BASE_URI, $httpClientOptions));
$httpClientOptions
contains:
array(1) {
["adapter"]=> string(29) "Zend\Http\Client\Adapter\Curl"
}
$accessToken
is an instance of ZendOAuth\Token\Access
.
On line 83 of ZendOAuth/Token/Access.php
:
$client = new Client($oauthOptions, $uri, $config, $excludeCustomParamsFromHeader);
What was in $httpClientOptions
is now in $config
and it's used to create an instance of ZendOAuth\Client
.
So the constructor of ZendOauth\Client
on line 61 calls
parent::__construct($uri, $config);
where $config
is sting the array containing the specified adapter. The parent constructor is on line 132 of the Zend\Http\Client
class.
This pull request seems to fix the unit tests I've added. Can you please take a look at it? I've closed the pull request because at one point it seemed like the problem wasn't on Zend\Http\Client
.
Thanks!
Hello, I hope these tests are useful. I've added three tests to check if the adapter passed in the http_client_options gets correctly initialized.
The first test
testAdapterAlwaysReachableIfSpecified
passes, but the other two don't. It seems there is some issue when passingaccess_token
.I got the problem while following the documentation on Authentication where it says that this configuration can be used: