Exemple #1
0
 function testBuildSignedUrl_UseApiParams()
 {
     $params = array('api_key' => TESTING_API_KEY, 'desc' => 'A "quoted" string');
     $result = Phlickr_Request::signParams('secret', $params);
     $this->assertEquals('api_key=' . TESTING_API_KEY . '&desc=A+%22quoted%22+string&api_sig=e1a598d192667408953c6c22668d7216', $result);
 }
Exemple #2
0
 /**
  * Build a URL to request a token.
  *
  * If a frob is omitted it is assumed that you've registered a callback URL
  * as per the Flickr documentation.
  *
  * @param   string $perms The desired permissions 'read', 'write', or
  *          'delete'.
  * @param   string $frob optional Frob
  * @return  void
  * @see     requestFrob()
  * @since   0.2.3
  * @uses    Phlickr_Request::signParams() to create a signed URL.
  */
 function buildAuthUrl($perms, $frob = '')
 {
     $params = array('api_key' => $this->getKey(), 'perms' => $perms);
     if ($frob != '') {
         $params['frob'] = (string) $frob;
     }
     return 'http://flickr.com/services/auth/?' . Phlickr_Request::signParams($this->getSecret(), $params);
 }