Exemple #1
0
 /**
  *
  */
 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);
 }
Exemple #2
0
 /**
  * @return Core_Curl
  */
 public function getApi()
 {
     $curl = Core_Curl::getInstance();
     $curl->setUrl(s()->version->current->url);
     return $curl;
 }