Skip to content
This repository
Browse code

Fixed failing OAuth request token tests

- Failures were due to changes in HTTP API; refactored accordingly
  • Loading branch information...
commit 7a082e4c5031b3dbd2c7350cd3a52c77d28357f1 1 parent e44c3f5
Matthew Weier O'Phinney weierophinney authored
13 library/Zend/OAuth/Http/RequestToken.php
@@ -110,10 +110,10 @@ public function getRequestSchemeHeaderClient(array $params)
110 110 );
111 111 $client = OAuth\OAuth::getHttpClient();
112 112 $client->setUri($this->_consumer->getRequestTokenUrl());
113   - $client->setHeaders('Authorization', $headerValue);
  113 + $client->setHeaders(array('Authorization' => $headerValue));
114 114 $rawdata = $this->_httpUtility->toEncodedQueryString($params, true);
115 115 if (!empty($rawdata)) {
116   - $client->setRawData($rawdata);
  116 + $client->getRequest()->setRawBody($rawdata);
117 117 }
118 118 $client->setMethod($this->_preferredRequestMethod);
119 119 return $client;
@@ -131,13 +131,12 @@ public function getRequestSchemePostBodyClient(array $params)
131 131 $client = OAuth\OAuth::getHttpClient();
132 132 $client->setUri($this->_consumer->getRequestTokenUrl());
133 133 $client->setMethod($this->_preferredRequestMethod);
134   - $client->setRawData(
  134 + $client->getRequest()->setRawBody(
135 135 $this->_httpUtility->toEncodedQueryString($params)
136 136 );
137   - $client->setHeaders(
138   - Http\Client::CONTENT_TYPE,
139   - Http\Client::ENC_URLENCODED
140   - );
  137 + $client->setHeaders(array(
  138 + 'Content-Type' => Http\Client::ENC_URLENCODED,
  139 + ));
141 140 return $client;
142 141 }
143 142
5 tests/Zend/OAuth/Http/RequestTokenTest.php
@@ -221,5 +221,8 @@ public function sign(array $params, $signatureMethod, $consumerSecret,
221 221
222 222 class HTTPClient32874 extends \Zend\Http\Client
223 223 {
224   - public function getRawData(){return $this->raw_post_data;}
  224 + public function getRawData()
  225 + {
  226 + return $this->getRequest()->getRawBody();
  227 + }
225 228 }

0 comments on commit 7a082e4

Please sign in to comment.
Something went wrong with that request. Please try again.