public function testGetMultiBaseInfo() { $str = 'service=User.GetMultiBaseInfo&user_ids=1,2,3'; parse_str($str, $params); DI()->request = new PhalApi_Request($params); $api = new Api_User(); //自己进行初始化 $api->init(); $rs = $api->getMultiBaseInfo(); $this->assertNotEmpty($rs); $this->assertArrayHasKey('code', $rs); $this->assertArrayHasKey('msg', $rs); $this->assertArrayHasKey('list', $rs); foreach ($rs['list'] as $item) { $this->assertArrayHasKey('id', $item); $this->assertArrayHasKey('name', $item); $this->assertArrayHasKey('from', $item); } }
public function edit($arg) { $user = $this->Mdl_Users->get($arg); parent::initView($this->ctrlName . '/edit', 'users', 'Edit iprayee information.', $user); parent::loadView(); }
break; case 'updateUserInfo': header("content-type: text/xml"); $apiUser = new Api_User(); print $apiUser->updateUserInfo($apikey, $secret); break; case 'blockUser': header("content-type: text/xml"); $apiUser = new Api_User(); print $apiUser->blockUser($apikey, $secret); break; case 'getBaseUserByUsername': header("content-type: text/xml"); $auth = new Auth($apikey, $secret); if ($auth->isAuthenticate()) { $apiUser = new Api_User(); print $apiUser->getBaseUserByUsername($apikey, $secret); } break; case 'getCategories': header("content-type: text/xml"); $auth = new Auth($apikey, $secret); if ($auth->isAuthenticate()) { $article = new Article(); print $article->getCategories(); } break; case 'getSections': header("content-type: text/xml"); $auth = new Auth($apikey, $secret); if ($auth->isAuthenticate()) {