Ejemplo n.º 1
0
 /**
  * Tests url encoding
  *
  * @see http://wiki.oauth.net/w/page/12238556/TestCases
  */
 public function testParameterEncoding()
 {
     $values = array('abcABC123' => 'abcABC123', '-._~' => '-._~', '%' => '%25', '+' => '%2B', '&=*' => '%26%3D%2A', "\n" => '%0A', " " => '%20');
     foreach ($values as $k => $v) {
         $this->assertEquals($v, Oauth::urlEncode($k));
     }
 }
Ejemplo n.º 2
0
 public function build($baseString, $consumerSecret, $tokenSecret = '')
 {
     $key = Oauth::urlEncode($consumerSecret) . '&' . Oauth::urlEncode($tokenSecret);
     return Oauth::urlEncode($key);
 }
Ejemplo n.º 3
0
 public function build($baseString, $consumerSecret, $tokenSecret = '')
 {
     $key = Oauth::urlEncode($consumerSecret) . '&' . Oauth::urlEncode($tokenSecret);
     $signature = base64_encode(hash_hmac('sha1', $baseString, $key, true));
     return $signature;
 }