add_follow(array('user_id' => 36490,'friends'=>[1,2,3,4,5])); $result = search\relation_client::instance()->add_follow(array('user_id' => 36490,'friends'=>[3,4,5,6,7])); } public function testDelFollow() { $result = search\relation_client::instance()->del_follow(array('user_id' => 36490,'friends'=>[1])); $result = search\relation_client::instance()->del_follow(array('user_id' => 36490,'friends'=>[3,4])); } public function testFetchFollow() { for ($i =0 ; $i < 10000; ++$i) { $result = search\relation_client::instance()->fetch_follow(array('user_id' => 36490)); } } public function testAddSpecial() { $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 7]))); $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 6]))); $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 9]))); $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 17]))); $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 16]))); $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 19]))); } public function testDelSpecial() { $result = search\relation_client::instance()->add_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 9]))); $result = search\relation_client::instance()->del_special(array('user_id' => 36490,'specials'=>array(['type' => 0,'spid' => 9]))); } public function testFetchPub() { $result = search\relation_client::instance()->fetch_pub_special(['special_id' => -1,'count'=> 1000,'type' => 1]); for ($i =0 ; $i < 10000; ++$i) { $result = search\relation_client::instance()->fetch_pub_special(['special_id' => 11,'count'=> 10,'type' => 1]); $result = search\relation_client::instance()->fetch_pub_special(['special_id' => 11,'count'=> 10,'type' => 0]); $result = search\relation_client::instance()->fetch_pub_special(['special_id' => 9,'count'=> 10,'type' => 0]); $result = search\relation_client::instance()->fetch_pub_special(['special_id' => 9,'count'=> 10,'type' => 1]); } } //publisher public function testAddFriend() { $publisher = new message\publisher(); $publisher->add_fellow(36490,[1,2,3,57]); } public function testDelFriend() { $publisher = new message\publisher(); $publisher->del_fellow(36490,[1,2,3,57]); } public function testAddSpecials() { $publisher = new message\publisher(); $publisher->add_special(36490,array(['type' => 1, 'spid' =>1],['type' => 1,'spid' => 2],['type' => 1,'spid' => 3])); } public function testDelSpecials() { $publisher = new message\publisher(); $publisher->del_special(36490,array(['type' => 1, 'spid' =>1],['type' => 1,'spid' => 2],['type' => 1,'spid' => 3])); } public function testFetchSelfSpecials() { $result = search\relation_client::instance()->fetch_self_special(['user_id' => 39621, 'special_id' => -1,'count'=> 20,'type' => 1]); } }