public function testSignatureWithFileParameters()
 {
     $this->request->setBaseUrl('https://api.twitter.com/oauth');
     $this->request->setPath('/statuses/show.json');
     $this->request->setMethod('POST');
     $this->request->setOAuthParameters(array('oauth_nonce' => 'abcde', 'oauth_timestamp' => '1380373886', 'oauth_version' => '1.0', 'oauth_token' => 'oauth_token'));
     $this->request->setFileParameter('file', __FILE__);
     $this->assertSame('POST&https%3A%2F%2Fapi.twitter.com%2Foauth%2Fstatuses%2Fshow.json&oauth_nonce%3Dabcde%26oauth_timestamp%3D1380373886%26oauth_token%3Doauth_token%26oauth_version%3D1.0', $this->request->getSignature());
 }
Exemple #2
0
 /**
  * Creates an OAuth request.
  *
  * @param string $path           The OAuth path.
  * @param string $responseFormat The response format.
  *
  * @return \Widop\Twitter\OAuth\OAuthRequest The OAuth request.
  */
 private function createRequest($path, $responseFormat = OAuthResponse::FORMAT_JSON)
 {
     $request = new OAuthRequest();
     $request->setBaseUrl($this->getUrl());
     $request->setPath($path);
     $request->setMethod(OAuthRequest::METHOD_POST);
     $request->setResponseFormat($responseFormat);
     return $request;
 }