Index: tests/Zend/Oauth/OauthTest.php
===================================================================
--- tests/Zend/Oauth/OauthTest.php (revision 24413)
+++ tests/Zend/Oauth/OauthTest.php (working copy)
@@ -183,4 +183,43 @@
$this->assertNotContains('realm=""',$client->getHeader('Authorization'));
$this->assertContains('realm="someRealm"',$client->getHeader('Authorization'));
}
+
+ /**
+ * @group ZF-11663
+ */
+ public function testOauthClientAcceptsGetParametersThroughSetter()
+ {
+ require_once "Zend/Oauth/Token/Access.php";
+ $token = new Zend_Oauth_Token_Access();
+
+ $options = array(
+ 'requestMethod' => 'GET',
+ 'requestScheme' => Zend_Oauth::REQUEST_SCHEME_QUERYSTRING,
+ 'realm' => 'someRealm'
+ );
+
+ require_once 'Zend/Oauth/Client.php';
+ $client = new Zend_Oauth_Client($options);
+ $client->setToken($token);
+ $client->setUri('http:+ $queryString = $client->getUri()->getQuery();
+
+ + $this->assertSame('test=FooBar', $queryString);
+
+ + $client->setParameterGet('test', 'FooBaz');
+ $client->setParameterGet('second', 'TestTest');
+
+ + $client->prepareOauth();
+ $queryString = $client->getUri()->getQuery();
+
+ + + $this->assertContains('test=FooBar', $queryString);
+
+ + $this->assertContains('second=TestTest', $queryString);
+ }
}
The issue here is that Zend_Oauth_Client takes the GET parameters directly from the URI provided:
So, we have two sources of GET parameters. That begs the question: Which takes precedence, the ones set in the URI or the ones set directly in the client?