Пример #1
0
 public function testUpdateAppProperties()
 {
     $app_id = "1200";
     $info = Api_Dao_App::getApplicationInfoById($app_id, RingsideSocialConfig::$apiKey);
     $res = $info[0]->toArray();
     $oldCanvasUrl = $res["canvas_url"];
     $oldAuthor = $res["author"];
     $oldDescription = $res["description"];
     $newSecret = "newsecret";
     $newCanvasUrl = "newcanvasurl";
     $newAuthor = "newauthor";
     $newDescription = "newdescription";
     $props = array();
     $props["RingsideApp.canvas_url"] = $newCanvasUrl;
     $props["RingsideApp.author"] = $newAuthor;
     $props["RingsideApp.description"] = $newDescription;
     Api_Dao_App::updateAppProperties($app_id, $props, RingsideSocialConfig::$apiKey);
     $info = Api_Dao_App::getApplicationInfoById($app_id, RingsideSocialConfig::$apiKey);
     $res = $info[0]->toArray();
     $this->assertEquals($newCanvasUrl, $res["canvas_url"]);
     $this->assertEquals($newAuthor, $res["author"]);
     $this->assertEquals($newDescription, $res["description"]);
     $props = array();
     $props["RingsideApp.canvas_url"] = $oldCanvasUrl;
     $props["RingsideApp.author"] = $oldAuthor;
     $props["RingsideApp.description"] = $oldDescription;
     Api_Dao_App::updateAppProperties($app_id, $props, RingsideSocialConfig::$apiKey);
     $info = Api_Dao_App::getApplicationInfoById($app_id, RingsideSocialConfig::$apiKey);
     $res = $info[0]->toArray();
     $this->assertEquals($oldCanvasUrl, $res["canvas_url"]);
     $this->assertEquals($oldAuthor, $res["author"]);
     $this->assertEquals($oldDescription, $res["description"]);
 }
Пример #2
0
 /**
  * Enter description here...
  *
  * @param unknown_type $app_id
  * @param unknown_type $user_id
  * @param unknown_type $allows_status_update
  * @param unknown_type $allows_create_listing
  * @param unknown_type $allows_photo_upload
  * @param unknown_type $auth_information
  * @param unknown_type $auth_profile
  * @param unknown_type $auth_leftnav
  * @param unknown_type $auth_newsfeeds
  * @param unknown_type $profile_col
  * @param unknown_type $profile_order
  * @return unknown
  */
 public static function setUsersApp($app_id, $user_id, $allows_status_update = 0, $allows_create_listing = 0, $allows_photo_upload = 0, $auth_information = 0, $auth_profile = 0, $auth_leftnav = 0, $auth_newsfeeds = 0, $profile_col = 'wide', $profile_order = 0)
 {
     $response = Api_Dao_App::getApplicationInfoById($app_id);
     $a = $response[0];
     $fbml = $a['default_fbml'];
     if (Api_Dao_UsersApp::isUsersApp($app_id, $user_id)) {
         return Api_Dao_UsersApp::updateUsersApp($app_id, $user_id, $allows_status_update, $allows_create_listing, $allows_photo_upload, $auth_information, $auth_profile, $auth_leftnav, $auth_newsfeeds, $profile_col, $profile_order, $fbml);
     } else {
         return Api_Dao_UsersApp::createUsersApp($app_id, $user_id, $allows_status_update, $allows_create_listing, $allows_photo_upload, $auth_information, $auth_profile, $auth_leftnav, $auth_newsfeeds, $profile_col, $profile_order, $fbml);
     }
 }