예제 #1
0
 public function testExecute()
 {
     $appId = 2;
     $app_id = 2;
     $uid = 18034;
     $datatype = 1;
     $url = "http://ringsidenetworks.com";
     $refurl = "http://ringsidenetworks.com";
     $iid = "TestItemRemove5";
     $iids = $iid;
     try {
         $apiParams = array();
         $apiParams['iid'] = $iid;
         $faf = $this->initRest(new ItemsRemove(), $apiParams, $uid, $appId);
         $this->assertNotNull($faf, "ItemsRemove should not be null!");
         Api_Dao_Items::createItem($app_id, $iid, $url, $refurl, $datatype);
         $result = $faf->execute();
         $this->assertEquals($result['result'], '1');
         $retVal = Api_Dao_Items::getInfo($app_id, $iids, $datatype);
         $this->assertEquals(count($retVal), 0, "GetInfo Count: " . count($retVal) . "!=0");
     } catch (OpenFBAPIException $exception) {
         $this->fail($exception->getMessage() . "\n" . $exception->getTraceAsString());
     }
 }
예제 #2
0
파일: Items.php 프로젝트: jkinner/ringside
 /**
  * Enter description here...
  *
  * @param unknown_type $app_id
  * @param unknown_type $iids
  * @param unknown_type $datatype
  */
 public static function getInfo($app_id, $iids, $datatype)
 {
     return Api_Dao_Items::getInfo($app_id, $iids, $datatype)->toArray();
 }
예제 #3
0
 public function testExecute()
 {
     $appId = 67;
     $app_id = 67;
     $uid = 18036;
     $datatype = 55;
     $iid = "TestItemSetInfo14";
     $url = "http://www.ringsidenetworks.com";
     $refurl = "http://www.ringsidenetworks.com";
     $iids = $iid;
     try {
         // without datatype
         $apiParams = array();
         $apiParams['iid'] = $iid;
         $apiParams['url'] = $url;
         $apiParams['refurl'] = $refurl;
         $faf = $this->initRest(new ItemsSetInfo(), $apiParams, $uid, $appId);
         $this->assertNotNull($faf, "ItemsSetInfo should not be null!");
         // with datatype
         $apiParams = array();
         $apiParams['datatype'] = $datatype;
         $apiParams['iid'] = $iid;
         $apiParams['url'] = $url;
         $apiParams['refurl'] = $refurl;
         $faf = $this->initRest(new ItemsSetInfo(), $apiParams, $uid, $appId);
         $this->assertNotNull($faf, "ItemsSetInfo should not be null!");
         $result = $faf->execute();
         $this->assertEquals($result['result'], '1');
         $retVal = Api_Dao_Items::getInfo($app_id, $iids, $datatype);
         $a = $retVal[0]->toArray();
         $this->assertNotNull($a);
         $this->assertEquals($a['item_id'], $iid, "iid: " . $a['item_id'] . "!=" . $iid);
         $this->assertEquals($a['item_url'], $url, "url: " . $a['item_url'] . "!=" . $url);
         $this->assertEquals($a['item_refurl'], $refurl, "refurl: " . $a['item_refurl'] . "!=" . $refurl);
         $this->assertEquals($a['item_data_type'], $datatype, "datatype: " . $a['item_data_type'] . "!=" . $datatype);
     } catch (OpenFBAPIException $exception) {
         $this->fail($exception->getMessage() . "\n" . $exception->getTraceAsString());
     }
 }