/** * */ public function testValidLogin() { /* @var $curl Core_Curl */ $curl = Core_Curl::getInstance(); $curl->setUrl(cfg()->site_address); $rs = $curl->send(array('auth', 'index'), array('user' => 'luka', 'pass' => '123456')); $response = json_decode($rs); $this->assertEquals(1, $response->status); $user_data = Default_PlayersModel::get(array('user' => 'luka')); $this->assertEquals($user_data->session_id, $response->data->token); }
/** * @return Core_Curl */ public function getApi() { $curl = Core_Curl::getInstance(); $curl->setUrl(s()->version->current->url); return $curl; }